c++ - QMake 'subdirs' template - executing a target? -
I am putting together a build system for my QT app using a qmake .pro file which is' Uses subdiris' template. It works fine, and allows me to specify the order made for each goal, so the dependency works well, however, I have now added a tool for the project that the version number used by the main version (Build date, SVN modification, etc.) - I can build this version tool first, but when it is created, I want to create any In order to execute it more goals (this is a header file that includes the main app, including the version number.)
For example, my simple qmake file looks like this :
TEMPLATE = subdirs CONFIG + = ordered SUBDIRS = version \ lib \ tests \ mainapp
When the 'version' was created I executed it I want to do ('passing some arguments on command) -line) before' lib 'has been created.
Is it possible that anyone knows? I think Qmeck has a 'system' command that can execute the application, but I do not know how I can take advantage of it.
A related question relates to my unit test. These 'exams' live in the project and use the Qustest framework I want to execute the test exchanges before the creation of 'Menapp' and if the tests have failed (i.e. the exchange does not return zero) then I have to leave the manufacturing process Want to
I realize that QMAC is designed to produce makefile, so I would like a little more, but if someone gives me some indication then it will be very welcome.
I currently use QMAC to run my unit tests for two years And it works fine - and it works fine.
sarabya summary:
structure
/ H2>
/ myproject / myproject H myproject.cpp main.cpp myproject.pro / myproject / tests / myUnitTest.h MyUnitTest.cpp men.cpp test.pro
Using QMake to automatically run unit tests on the building
QMake target QMAKE_POST_LINK will link the user defined command.
t Ests.pri (normal file)
template = app DEPENDPATH = =. / Include + =. ../ DESTDIR = ./ CONFIG + = qtestlib unix: QMAKE_POST_LINK =. $$ Target Win32: QMAKE_POST_LINK = $$ {TARGET} .exe
tests.pro (project -specific file)
target = MyUnitTest headers + = MyUnitTest.h source + + = MyUnitTest.cpp main.cpp (test pre)
same main ( ) Run multiple unit tests in
main.cpp
# "MyUnitTest1.h" # Include # int main (int argc, Char ** argv) Include {QApplication app (argc, argv); Int Retal (0); Rated + = Qtist :: QXAC (and Mite 1,), AGRC, AGRV); Retval + = QTest :: qExec (and MyTest2 (), argc, argv); Return (Rev. 1: 0); }
It runs your test on each build and stops if any errors are found.
Note
If you receive the linker errors such as "LNK2005: xxx already defined ...", a new one for each test class header. Add a CP file and move some test method implementation.
You can actually use your versioning tool after compiling / constructing - so that your questions are solved: -)
If your Do not hesitate to ask me if there is any other question.
PS: Here you move around more (undocumented) Q Meke:
Comments
Post a Comment