summaryrefslogtreecommitdiffstats
path: root/mkspecs
diff options
context:
space:
mode:
authorOliver Wolff <oliver.wolff@qt.io>2018-06-28 18:03:43 +0200
committerOliver Wolff <oliver.wolff@qt.io>2018-07-25 05:17:47 +0000
commit92c5f3fb7b3f3a90e27be71e73395ac517f0b3ea (patch)
tree373f647be63db669ace77f1e8364bc4ad1791e3d /mkspecs
parent64d63d036c8938b88fa47e8036f1ebe0279b75cf (diff)
Add qt_test_helper feature
To avoid (even more) duplicated code, "qt_test_helper" ensures the policy of putting a test's helper application next to the test's own executable. The helper executable is suffixed with "_helper" to avoid name clashes with its folder. Change-Id: Ic50cb1daa257e7ffc75440c10a3b90fd39424683 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'mkspecs')
-rw-r--r--mkspecs/features/qt_test_helper.prf35
1 files changed, 35 insertions, 0 deletions
diff --git a/mkspecs/features/qt_test_helper.prf b/mkspecs/features/qt_test_helper.prf
new file mode 100644
index 0000000000..5daa14731d
--- /dev/null
+++ b/mkspecs/features/qt_test_helper.prf
@@ -0,0 +1,35 @@
+#
+# W A R N I N G
+# -------------
+#
+# This file is not part of the Qt API. It exists purely as an
+# implementation detail. It may change from version to version
+# without notice, or even be removed.
+#
+# We mean it.
+#
+
+# If an auto test needs a helper application, this helper should
+# be put into the same directory as the test itself. This common
+# folder should be the test's "main directory" or a "debug" or "release"
+# subfolder inside this main directory if debug_and_release is enabled.
+# Additionally the helper's executable is suffixed with "_helper" to
+# avoid name clashes with its folder.
+
+CONFIG -= app_bundle
+CONFIG += console
+
+debug_and_release {
+ CONFIG(debug, debug|release) {
+ TARGET = ../../debug/$${TARGET}_helper
+ } else {
+ TARGET = ../../release/$${TARGET}_helper
+ }
+} else {
+ TARGET = ../$${TARGET}_helper
+}
+
+parentFolder = $$dirname(_PRO_FILE_PWD_)
+testFolder = $$basename(parentFolder)
+target.path = $$[QT_INSTALL_TESTS]/$$testFolder
+INSTALLS += target