Introduce GENERATED_TESTDATA variable and fix qresourceengine test.

testcase.prf cannot be loaded from pro file for various reasons,
see qtbase commit history for details.

Moved runtime testdata logic from pro file to testdata.prf, and
thus made is reusable in other test cases as well.

Change-Id: I500d08dc4951e4eda862071e4ddd3e0f6de8c3d2
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
This commit is contained in:
Janne Anttila 2014-02-25 10:25:23 +02:00 committed by The Qt Project
parent 02abe7921b
commit 391c2c12ab
2 changed files with 23 additions and 8 deletions

View File

@ -134,6 +134,28 @@ contains(INSTALLS, target) {
INSTALLS += $$tdi
}
# Install GENERATED_TESTDATA.
# Logic is copied from the TESTDATA installation, only difference being that
# INSTALL target is added with CONFIG = no_check_exist
for(file, GENERATED_TESTDATA) {
tnam = $$file
tnam ~= s,\\.\\.,dotdot,
tnam ~= s,[?*],wildcard,
tnam ~= s,[^A-Za-z0-9],_,
tdi = testdata_$$tnam
tdif = $${tdi}.files
tdip = $${tdi}.path
tdic = $${tdi}.CONFIG
$$tdif = $$file
$$tdic = no_check_exist
file = $$replace(file, ^(\\.\\./)+, )
$$tdip = $${target.path}/$$dirname(file)
INSTALLS += $$tdi
}
# TEST_HELPER_INSTALLS specifies additional test helper executables for installation.
#
# Typical usage is:

View File

@ -14,12 +14,5 @@ PRE_TARGETDEPS += $${runtime_resource.target}
TESTDATA += \
parentdir.txt \
testqrc/*
# Special case needed for runtime_resource.rcc installation,
# since it does not exist at qmake runtime.
load(testcase) # to get value of target.path
runtime_resource_install.CONFIG = no_check_exist
runtime_resource_install.files = $$OUT_PWD/$${runtime_resource.target}
runtime_resource_install.path = $${target.path}
INSTALLS += runtime_resource_install
GENERATED_TESTDATA = $${runtime_resource.target}
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0