qmltestcase: Allow a QML-only testcase to not require a C++ harness
[ChangeLog][qmake] If you use CONFIG+=qmltestcase with no SOURCES, 'make check' will now run qmltestrunner for you. Change-Id: Ie9dfaef75494c9b38f6c9a6239754858535d8657 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>bb10
parent
be49235266
commit
727da2965c
|
|
@ -1,13 +1,19 @@
|
|||
CONFIG += testcase
|
||||
|
||||
QT += qml qmltest
|
||||
|
||||
mac: CONFIG -= app_bundle
|
||||
!isEmpty(SOURCES) {
|
||||
QT += qml qmltest
|
||||
load(testcase)
|
||||
CONFIG -= app_bundle
|
||||
DEFINES += QUICK_TEST_SOURCE_DIR=\"\\\"$$_PRO_FILE_PWD_\\\"\"
|
||||
} else {
|
||||
# Allow a project to run tests without a CPP stub
|
||||
TEMPLATE = aux
|
||||
QMAKE_EXTRA_TARGETS += check
|
||||
qtPrepareTool(QMAKE_QMLTESTRUNNER, qmltestrunner)
|
||||
check.commands = $$QMAKE_QMLTESTRUNNER
|
||||
}
|
||||
|
||||
# If the .pro file specified an IMPORTPATH, then add that to
|
||||
# the command-line when the test is run.
|
||||
!isEmpty(IMPORTPATH) {
|
||||
load(testcase)
|
||||
for(import, IMPORTPATH): check.commands += -import \"$$import\"
|
||||
}
|
||||
DEFINES += QUICK_TEST_SOURCE_DIR=\"\\\"$$_PRO_FILE_PWD_\\\"\"
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue