diff options
author | Robin Burchell <robin.burchell@crimson.no> | 2017-02-10 14:36:56 +0100 |
---|---|---|
committer | Robin Burchell <robin.burchell@crimson.no> | 2017-04-06 08:40:17 +0000 |
commit | 727da2965caa8bccf8bbfbdd571ed05b35251f82 (patch) | |
tree | 3d3a879f834eebf837754c4353b55840247bb0d1 /mkspecs | |
parent | be49235266f07cffc4f8e6008c98605de79a05a0 (diff) |
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>
Diffstat (limited to 'mkspecs')
-rw-r--r-- | mkspecs/features/qmltestcase.prf | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/mkspecs/features/qmltestcase.prf b/mkspecs/features/qmltestcase.prf index 335ba90009..4dfec50be8 100644 --- a/mkspecs/features/qmltestcase.prf +++ b/mkspecs/features/qmltestcase.prf @@ -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_\\\"\" + |