qtbase-opensource-src/mkspecs/features/qmltestcase.prf

26 lines
840 B
Plaintext
Raw Permalink Normal View History

2022-05-14 17:39:13 +08:00
!isEmpty(SOURCES) {
QT += qml qmltest
load(testcase)
!android {
contains(TEMPLATE, vc.*): DEFINES += QUICK_TEST_SOURCE_DIR=\"$$_PRO_FILE_PWD_\"
else: DEFINES += QUICK_TEST_SOURCE_DIR=$$shell_quote(\"$$_PRO_FILE_PWD_\")
} else {
!isEmpty(RESOURCES): warning("The RESOURCES qmake variable is empty, the test will probably fail to run")
DEFINES += QUICK_TEST_SOURCE_DIR=\":/\"
}
} 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) {
for(import, IMPORTPATH): check.commands += -import \"$$import\"
}