First structure source like below:
MyApp
MyAppUnitTest
Under MyApp
project, use a MyAppSrc.pri
to locate source files:
SOURCES +=
../../../framework/src/myapp.cpp
../../../framework/src/mycontrol.cpp
HEADERS +=
../../../framework/inc/myapp.h
../../../framework/inc/mycontrol.h
INCLUDEPATH += ../../../framework/extlibs
Include this .pri
in MyApp.pro
like:
include(MyAppSrc.pri)
Then structure the testing project exactly like the main project, with one extra include in MyAppUnitTest.pro
:
include(MyAppUnitTestSrc.pri)
include(../MyApp/MyAppSrc.pri)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…