> Sent: Wednesday, June 23, 2021 at 11:45 AM
> From: "Kai Köhne" <kai.koe...@qt.io>
> To: "Jason H" <jh...@gmx.com>, "interestqt-project.org" 
> <interest@qt-project.org>
> Subject: RE: [Interest] make check not working (macOS)
> HI Jason,
> It looks to me like you're trying to add a test case into your normal 
> application executable. Is that correct?

> The canonical use of QTest is different: You create a separate project for 
> the tests, in a separate directory. If you e.g. check back on 
> https://doc.qt.io/qt-5/qttestlib-tutorial1-example.html , this creates a new 
> file testqstring.cpp, and then uns "qmake -project" in the directory to 
> create a completely new project.
> Hope this helps.

Yes it does. Thanks!

So I have to manually maintain the modules being tested as a separate project? 
If so, that's pretty undesirable because of the manual effort to make sure that 
the test project is using the same source that the actual application uses. I 
hope I can automate that somehow? (Preferably requiring 0 maintenance)  I would 
not be opposed to a "tests" subdir to hold this project, but then, that needs 
it's own .pro, and it needs to automatically reference the parent project's 
files. Immediately I am thinking I can just use HEADERS/SOURCES files with ../ 
prefixes but that violates my 0-maintenance requirement.

I want a brain-dead, simple, 0-maintenance test kit.  The only thing the 
developers should have to worry about is adding test implementations once it is 

Can this be achieved in Qt?

Interest mailing list

Reply via email to