From 422e8a443fc46af5ee09faae1200d49028e14e5f Mon Sep 17 00:00:00 2001 From: Matt Vogt Date: Wed, 19 Jun 2013 17:53:18 +1000 Subject: [PATCH] [transfer-engine] Install tests to independent location with Qt5 --- rpm/transfer-engine-qt5.spec | 2 +- tests/tests.pro | 23 +++++++++++++++++++---- tests/{tests.xml => tests.xml.in} | 6 +++--- 3 files changed, 23 insertions(+), 8 deletions(-) rename tests/{tests.xml => tests.xml.in} (61%) diff --git a/rpm/transfer-engine-qt5.spec b/rpm/transfer-engine-qt5.spec index 472a87b..2031ecf 100644 --- a/rpm/transfer-engine-qt5.spec +++ b/rpm/transfer-engine-qt5.spec @@ -80,7 +80,7 @@ Unit tests for Nemo TransferEngine %files tests %defattr(-,root,root,-) -/opt/tests/nemo-transfer-engine/* +/opt/tests/nemo-transfer-engine-qt5/* %package doc Summary: Documentation for Nemo TransferEngine diff --git a/tests/tests.pro b/tests/tests.pro index fe38908..7bbdc91 100644 --- a/tests/tests.pro +++ b/tests/tests.pro @@ -1,3 +1,6 @@ +equals(QT_MAJOR_VERSION, 4): PACKAGENAME = nemo-transfer-engine +equals(QT_MAJOR_VERSION, 5): PACKAGENAME = nemo-transfer-engine-qt5 + TEMPLATE = app TARGET = ut_nemo-transfer-engine DEPENDPATH += . @@ -31,12 +34,24 @@ SOURCES += \ QT += testlib -PATH = /opt/tests/nemo-transfer-engine +PATH = /opt/tests/$${PACKAGENAME} + +tests_xml.target = tests.xml +tests_xml.depends = $$PWD/tests.xml.in +tests_xml.commands = sed -e "s:@PACKAGENAME@:$${PACKAGENAME}:g" $< > $@ + +QMAKE_EXTRA_TARGETS = tests_xml +QMAKE_CLEAN += $$tests_xml.target +PRE_TARGETDEPS += $$tests_xml.target + +tests_install.depends = tests_xml +tests_install.path = $$PATH +tests_install.files = $$tests_xml.target +tests_install.CONFIG += no_check_exist -test_def.files = tests.xml -test_def.path = $$PATH resources.files = images/testimage.jpg resources.path = $$PATH/images + target.path = $$PATH -INSTALLS += target resources test_def +INSTALLS += target resources tests_install diff --git a/tests/tests.xml b/tests/tests.xml.in similarity index 61% rename from tests/tests.xml rename to tests/tests.xml.in index 30e38ec..03185ce 100644 --- a/tests/tests.xml +++ b/tests/tests.xml.in @@ -1,11 +1,11 @@ - + Nemo Transfer Engine automatic tests - + Nemo Transfer Engine unit tests - /opt/tests/nemo-transfer-engine/ut_nemo-transfer-engine + /opt/tests/@PACKAGENAME@/ut_nemo-transfer-engine