[Development] Using QtCreator for Qt development
EXT Mitch Curtis
mitch.curtis at qt.io
Mon Dec 12 11:30:30 CET 2022
> -----Original Message-----
> From: Development <development-bounces at qt-project.org> On Behalf Of
> Eike Ziller via Development
> Sent: Monday, 12 December 2022 5:20 PM
> To: Владимир Белявский <belyavskyv at gmail.com>
> Cc: development at qt-project.org
> Subject: Re: [Development] Using QtCreator for Qt development
> > Am 10/12/2022 um 13:57 schrieb Владимир Белявский
> <belyavskyv at gmail.com>:
> > also view all unit tests there, debug, fix, build and run selected directly and
> so on?
> I think the only well-supported Qt configuration is with QT_BUILD_TESTS=ON
> and QT_BUILD_TESTS_BY_DEFAULT=ON. Or are there CMake variables to
> turn individual test on for the build?
Владимир, I use these configure args:
-DCMAKE_BUILD_TYPE=Debug -DFEATURE_developer_build=ON -DQT_BUILD_TESTS=ON -DQT_BUILD_TESTS_BY_DEFAULT=OFF -DQT_BUILD_EXAMPLES=ON -DQT_BUILD_EXAMPLES_BY_DEFAULT=OFF -DFEATURE_sanitize_address=ON
The test and example-related ones will ensure that you can build tests and examples (in Creator), but by default they won't be built, which saves a lot of time.
I use Alt+B,Alt+R ("Build for Run Configuration") to build the currently selected/active (the target that comes up when you hit Ctrl+T) test, as building the top-level qtdeclarative project won't do that with the configure args above.
> Anyway, with both on, you can just choose a test to run & debug. It looks like
> our autotest integration (the separate "Tests" panel) takes ages looking for
> tests, but running tests directly as normal run configurations works fine.
For what it's worth, I disable the AutoTest plugin, and use application arguments to run specific test(s) instead.
> Qt also has some mechanism for opening tests as separate CMake projects,
> but I don't know how that works.
> Br, Eike
> Eike Ziller
> Principal Software Engineer
> The Qt Company GmbH
> Erich-Thilo-Straße 10
> D-12489 Berlin
> eike.ziller at qt.io
> Geschäftsführer: Mika Pälsi,
> Juha Varelius, Jouni Lintunen
> Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg,
> HRB 144331 B
> Development mailing list
> Development at qt-project.org
More information about the Development