[Qt-interest] Running unit tests

Rohan McGovern rohan.mcgovern at nokia.com
Thu Nov 3 00:05:46 CET 2011


Esdras Beleza said:
> Hi,
> 
> I'm used to create Qt projects in Qt Creator, but now I'm trying to create
> a more serious project and do some unit tests in a new project.
> 
> I created a new subdirs-based project, and inside of it I put another
> project, also subdirs-based, called "tests". Inside of this "tests"
> projects, there are some directories containing the unit tests I need. They
> are built and, inside of the build directory, are their binaries.
> 
> if I ask Qt Creator to run my project, it runs the binary of the first
> project it finds.
> 
> I don't know if I'm doing it right. How do you run Qt-based unit tests?
> 

If you have Qt >= 4.7, try putting CONFIG+=testcase in the .pro file of
every unit test project, then invoke `make check' to run them all.
(`make -k check' if you want to keep running even if some of them fail)



More information about the Qt-interest-old mailing list