diff options
author | Rohan McGovern <rohan.mcgovern@nokia.com> | 2011-11-24 10:36:10 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-12-01 09:12:52 +0100 |
commit | 3385fb91e1e55e1bfa1f78dfb8ce2e9f3fdaedef (patch) | |
tree | b77bb527bf3a21dc95a317248b2640c73751f629 /tests/auto/corelib/io/qprocess | |
parent | 13eba9ddf47d570fc4562c20fcfbacd1dfa4a61a (diff) |
Fixed installation of corelib tests
In .pro files, removed wince/symbian-specific DEPLOYMENT cases and
replaced them with TESTDATA where appropriate.
In .cpp files, removed SRCDIR and relative paths to testdata and
replaced them with the QFINDTESTDATA macro where appropriate.
Modified test helper apps/libs to install themselves under the test
they relate to.
This change allows corelib tests to be correctly installed, along with
their testdata, via `make install'.
Change-Id: I5e202e2f3b577af7e39072d5c9fe13e0ca125304
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Diffstat (limited to 'tests/auto/corelib/io/qprocess')
23 files changed, 83 insertions, 159 deletions
diff --git a/tests/auto/corelib/io/qprocess/fileWriterProcess/fileWriterProcess.pro b/tests/auto/corelib/io/qprocess/fileWriterProcess/fileWriterProcess.pro index c9f87ba361..360981f83c 100644 --- a/tests/auto/corelib/io/qprocess/fileWriterProcess/fileWriterProcess.pro +++ b/tests/auto/corelib/io/qprocess/fileWriterProcess/fileWriterProcess.pro @@ -4,7 +4,6 @@ CONFIG -= app_bundle QT = core DESTDIR = ./ -# no install rule for application used by test -INSTALLS = - - +# This app is testdata for tst_qprocess +target.path = $$[QT_INSTALL_TESTS]/tst_qprocess/$$TARGET +INSTALLS += target diff --git a/tests/auto/corelib/io/qprocess/test/test.pro b/tests/auto/corelib/io/qprocess/test/test.pro index bb21f76dd1..39ce734c56 100644 --- a/tests/auto/corelib/io/qprocess/test/test.pro +++ b/tests/auto/corelib/io/qprocess/test/test.pro @@ -3,92 +3,13 @@ QT = core testlib network embedded: QT += gui SOURCES = ../tst_qprocess.cpp -!wince*: { - TARGET = ../tst_qprocess - win32: { - CONFIG(debug, debug|release) { - TARGET = ../../debug/tst_qprocess - } else { - TARGET = ../../release/tst_qprocess - } +TARGET = ../tst_qprocess +win32 { + CONFIG(debug, debug|release) { + TARGET = ../../debug/tst_qprocess + } else { + TARGET = ../../release/tst_qprocess } -} else { - TARGET = tst_qprocess - addFile_fileWriterProcess.files = $$OUT_PWD/../fileWriterProcess/fileWriterProcess.exe - addFile_fileWriterProcess.path = fileWriterProcess - - addFile_testBatFiles.files = $$PWD/../testBatFiles/* - addFile_testBatFiles.path = testBatFiles - - addFile_testDetached.files = $$OUT_PWD/../testDetached/testDetached.exe - addFile_testDetached.path = testDetached - - addFile_testExitCodes.files = $$OUT_PWD/../testExitCodes/testExitCodes.exe - addFile_testExitCodes.path = testExitCodes - - addFile_testGuiProcess.files = $$OUT_PWD/../testGuiProcess/testGuiProcess.exe - addFile_testGuiProcess.path = testGuiProcess - - addFile_testProcessCrash.files = $$OUT_PWD/../testProcessCrash/testProcessCrash.exe - addFile_testProcessCrash.path = testProcessCrash - - addFile_testProcessDeadWhileReading.files = $$OUT_PWD/../testProcessDeadWhileReading/testProcessDeadWhileReading.exe - addFile_testProcessDeadWhileReading.path = testProcessDeadWhileReading - - addFile_testProcessEcho.files = $$OUT_PWD/../testProcessEcho/testProcessEcho.exe - addFile_testProcessEcho.path = testProcessEcho - - addFile_testProcessEcho2.files = $$OUT_PWD/../testProcessEcho2/testProcessEcho2.exe - addFile_testProcessEcho2.path = testProcessEcho2 - - addFile_testProcessEcho3.files = $$OUT_PWD/../testProcessEcho3/testProcessEcho3.exe - addFile_testProcessEcho3.path = testProcessEcho3 - - addFile_testProcessEOF.files = $$OUT_PWD/../testProcessEOF/testProcessEOF.exe - addFile_testProcessEOF.path = testProcessEOF - - addFile_testProcessLoopback.files = $$OUT_PWD/../testProcessLoopback/testProcessLoopback.exe - addFile_testProcessLoopback.path = testProcessLoopback - - addFile_testProcessNormal.files = $$OUT_PWD/../testProcessNormal/testProcessNormal.exe - addFile_testProcessNormal.path = testProcessNormal - - addFile_testProcessOutput.files = $$OUT_PWD/../testProcessOutput/testProcessOutput.exe - addFile_testProcessOutput.path = testProcessOutput - - addFile_testProcessNoSpacesArgs.files = $$OUT_PWD/../testProcessSpacesArgs/nospace.exe - addFile_testProcessNoSpacesArgs.path = testProcessSpacesArgs - - addFile_testProcessOneSpacesArgs.files = $$OUT_PWD/../testProcessSpacesArgs/"one space".exe - addFile_testProcessOneSpacesArgs.path = testProcessSpacesArgs - - addFile_testProcessTwoSpacesArgs.files = $$OUT_PWD/../testProcessSpacesArgs/"two space s".exe - addFile_testProcessTwoSpacesArgs.path = testProcessSpacesArgs - - addFile_testSoftExit.files = $$OUT_PWD/../testSoftExit/testSoftExit.exe - addFile_testSoftExit.path = testSoftExit - - addFile_testSpaceInName.files = $$OUT_PWD/../"test Space In Name"/testSpaceInName.exe - addFile_testSpaceInName.path = "test Space In Name" - - DEPLOYMENT += addFile_fileWriterProcess \ - addFile_testBatFiles \ - addFile_testDetached \ - addFile_testExitCodes \ - addFile_testGuiProcess \ - addFile_testProcessCrash \ - addFile_testProcessDeadWhileReading \ - addFile_testProcessEcho \ - addFile_testProcessEcho2 \ - addFile_testProcessEcho3 \ - addFile_testProcessEchoGui \ - addFile_testProcessEOF \ - addFile_testProcessLoopback \ - addFile_testProcessNormal \ - addFile_testProcessOutput \ - addFile_testProcessNoSpacesArgs \ - addFile_testProcessOneSpacesArgs \ - addFile_testProcessTwoSpacesArgs \ - addFile_testSoftExit \ - addFile_testSpaceInName } + +TESTDATA += ../testBatFiles/* diff --git a/tests/auto/corelib/io/qprocess/testDetached/testDetached.pro b/tests/auto/corelib/io/qprocess/testDetached/testDetached.pro index 8d1fcba624..e307379014 100644 --- a/tests/auto/corelib/io/qprocess/testDetached/testDetached.pro +++ b/tests/auto/corelib/io/qprocess/testDetached/testDetached.pro @@ -4,3 +4,7 @@ CONFIG += console CONFIG -= app_bundle INSTALLS = DESTDIR = ./ + +# This app is testdata for tst_qprocess +target.path = $$[QT_INSTALL_TESTS]/tst_qprocess/$$TARGET +INSTALLS += target diff --git a/tests/auto/corelib/io/qprocess/testExitCodes/testExitCodes.pro b/tests/auto/corelib/io/qprocess/testExitCodes/testExitCodes.pro index b08371804f..afa8e4ccab 100644 --- a/tests/auto/corelib/io/qprocess/testExitCodes/testExitCodes.pro +++ b/tests/auto/corelib/io/qprocess/testExitCodes/testExitCodes.pro @@ -3,3 +3,7 @@ CONFIG -= qt app_bundle CONFIG += console DESTDIR = ./ + +# This app is testdata for tst_qprocess +target.path = $$[QT_INSTALL_TESTS]/tst_qprocess/$$TARGET +INSTALLS += target diff --git a/tests/auto/corelib/io/qprocess/testGuiProcess/testGuiProcess.pro b/tests/auto/corelib/io/qprocess/testGuiProcess/testGuiProcess.pro index b26a583dee..992188b443 100644 --- a/tests/auto/corelib/io/qprocess/testGuiProcess/testGuiProcess.pro +++ b/tests/auto/corelib/io/qprocess/testGuiProcess/testGuiProcess.pro @@ -3,3 +3,6 @@ QT += widgets CONFIG += console DESTDIR = ./ +# This app is testdata for tst_qprocess +target.path = $$[QT_INSTALL_TESTS]/tst_qprocess/$$TARGET +INSTALLS += target diff --git a/tests/auto/corelib/io/qprocess/testProcessCrash/testProcessCrash.pro b/tests/auto/corelib/io/qprocess/testProcessCrash/testProcessCrash.pro index abd8167313..98c5b966f2 100644 --- a/tests/auto/corelib/io/qprocess/testProcessCrash/testProcessCrash.pro +++ b/tests/auto/corelib/io/qprocess/testProcessCrash/testProcessCrash.pro @@ -4,5 +4,6 @@ CONFIG -= qt app_bundle DESTDIR = ./ -# no install rule for application used by test -INSTALLS = +# This app is testdata for tst_qprocess +target.path = $$[QT_INSTALL_TESTS]/tst_qprocess/$$TARGET +INSTALLS += target diff --git a/tests/auto/corelib/io/qprocess/testProcessDeadWhileReading/testProcessDeadWhileReading.pro b/tests/auto/corelib/io/qprocess/testProcessDeadWhileReading/testProcessDeadWhileReading.pro index 2168ba5672..a5f4697605 100644 --- a/tests/auto/corelib/io/qprocess/testProcessDeadWhileReading/testProcessDeadWhileReading.pro +++ b/tests/auto/corelib/io/qprocess/testProcessDeadWhileReading/testProcessDeadWhileReading.pro @@ -4,7 +4,6 @@ CONFIG += console DESTDIR = ./ -# no install rule for application used by test -INSTALLS = - - +# This app is testdata for tst_qprocess +target.path = $$[QT_INSTALL_TESTS]/tst_qprocess/$$TARGET +INSTALLS += target diff --git a/tests/auto/corelib/io/qprocess/testProcessEOF/testProcessEOF.pro b/tests/auto/corelib/io/qprocess/testProcessEOF/testProcessEOF.pro index 756bd23bb0..4efdad997d 100644 --- a/tests/auto/corelib/io/qprocess/testProcessEOF/testProcessEOF.pro +++ b/tests/auto/corelib/io/qprocess/testProcessEOF/testProcessEOF.pro @@ -5,5 +5,6 @@ CONFIG += console win32:!win32-g++*:!equals(TEMPLATE_PREFIX, "vc"):QMAKE_CXXFLAGS += /GS- DESTDIR = ./ - - +# This app is testdata for tst_qprocess +target.path = $$[QT_INSTALL_TESTS]/tst_qprocess/$$TARGET +INSTALLS += target diff --git a/tests/auto/corelib/io/qprocess/testProcessEcho/testProcessEcho.pro b/tests/auto/corelib/io/qprocess/testProcessEcho/testProcessEcho.pro index a14c1fe163..f8dc695c17 100644 --- a/tests/auto/corelib/io/qprocess/testProcessEcho/testProcessEcho.pro +++ b/tests/auto/corelib/io/qprocess/testProcessEcho/testProcessEcho.pro @@ -3,6 +3,6 @@ CONFIG -= qt CONFIG += console DESTDIR = ./ -# no install rule for application used by test -INSTALLS = - +# This app is testdata for tst_qprocess +target.path = $$[QT_INSTALL_TESTS]/tst_qprocess/$$TARGET +INSTALLS += target diff --git a/tests/auto/corelib/io/qprocess/testProcessEcho2/testProcessEcho2.pro b/tests/auto/corelib/io/qprocess/testProcessEcho2/testProcessEcho2.pro index d8a303a22b..f8dc695c17 100644 --- a/tests/auto/corelib/io/qprocess/testProcessEcho2/testProcessEcho2.pro +++ b/tests/auto/corelib/io/qprocess/testProcessEcho2/testProcessEcho2.pro @@ -3,8 +3,6 @@ CONFIG -= qt CONFIG += console DESTDIR = ./ -# no install rule for application used by test -INSTALLS = - - - +# This app is testdata for tst_qprocess +target.path = $$[QT_INSTALL_TESTS]/tst_qprocess/$$TARGET +INSTALLS += target diff --git a/tests/auto/corelib/io/qprocess/testProcessEcho3/testProcessEcho3.pro b/tests/auto/corelib/io/qprocess/testProcessEcho3/testProcessEcho3.pro index 3b8f2fb0d7..f8dc695c17 100644 --- a/tests/auto/corelib/io/qprocess/testProcessEcho3/testProcessEcho3.pro +++ b/tests/auto/corelib/io/qprocess/testProcessEcho3/testProcessEcho3.pro @@ -3,7 +3,6 @@ CONFIG -= qt CONFIG += console DESTDIR = ./ -# no install rule for application used by test -INSTALLS = - - +# This app is testdata for tst_qprocess +target.path = $$[QT_INSTALL_TESTS]/tst_qprocess/$$TARGET +INSTALLS += target diff --git a/tests/auto/corelib/io/qprocess/testProcessEchoGui/testProcessEchoGui.pro b/tests/auto/corelib/io/qprocess/testProcessEchoGui/testProcessEchoGui.pro index b3be74cbd1..65b408fc85 100644 --- a/tests/auto/corelib/io/qprocess/testProcessEchoGui/testProcessEchoGui.pro +++ b/tests/auto/corelib/io/qprocess/testProcessEchoGui/testProcessEchoGui.pro @@ -6,8 +6,6 @@ win32 { CONFIG -= qt DESTDIR = ./ -# no install rule for application used by test -INSTALLS = - - - +# This app is testdata for tst_qprocess +target.path = $$[QT_INSTALL_TESTS]/tst_qprocess/$$TARGET +INSTALLS += target diff --git a/tests/auto/corelib/io/qprocess/testProcessEnvironment/testProcessEnvironment.pro b/tests/auto/corelib/io/qprocess/testProcessEnvironment/testProcessEnvironment.pro index 14ddae50f3..43378b6e17 100644 --- a/tests/auto/corelib/io/qprocess/testProcessEnvironment/testProcessEnvironment.pro +++ b/tests/auto/corelib/io/qprocess/testProcessEnvironment/testProcessEnvironment.pro @@ -7,6 +7,6 @@ mac { CONFIG -= app_bundle } -# no install rule for application used by test -INSTALLS = - +# This app is testdata for tst_qprocess +target.path = $$[QT_INSTALL_TESTS]/tst_qprocess/$$TARGET +INSTALLS += target diff --git a/tests/auto/corelib/io/qprocess/testProcessLoopback/testProcessLoopback.pro b/tests/auto/corelib/io/qprocess/testProcessLoopback/testProcessLoopback.pro index a14c1fe163..f8dc695c17 100644 --- a/tests/auto/corelib/io/qprocess/testProcessLoopback/testProcessLoopback.pro +++ b/tests/auto/corelib/io/qprocess/testProcessLoopback/testProcessLoopback.pro @@ -3,6 +3,6 @@ CONFIG -= qt CONFIG += console DESTDIR = ./ -# no install rule for application used by test -INSTALLS = - +# This app is testdata for tst_qprocess +target.path = $$[QT_INSTALL_TESTS]/tst_qprocess/$$TARGET +INSTALLS += target diff --git a/tests/auto/corelib/io/qprocess/testProcessNormal/testProcessNormal.pro b/tests/auto/corelib/io/qprocess/testProcessNormal/testProcessNormal.pro index 3c6a595d85..98c5b966f2 100644 --- a/tests/auto/corelib/io/qprocess/testProcessNormal/testProcessNormal.pro +++ b/tests/auto/corelib/io/qprocess/testProcessNormal/testProcessNormal.pro @@ -4,6 +4,6 @@ CONFIG -= qt app_bundle DESTDIR = ./ -# no install rule for application used by test -INSTALLS = - +# This app is testdata for tst_qprocess +target.path = $$[QT_INSTALL_TESTS]/tst_qprocess/$$TARGET +INSTALLS += target diff --git a/tests/auto/corelib/io/qprocess/testProcessOutput/testProcessOutput.pro b/tests/auto/corelib/io/qprocess/testProcessOutput/testProcessOutput.pro index 3b8f2fb0d7..f8dc695c17 100644 --- a/tests/auto/corelib/io/qprocess/testProcessOutput/testProcessOutput.pro +++ b/tests/auto/corelib/io/qprocess/testProcessOutput/testProcessOutput.pro @@ -3,7 +3,6 @@ CONFIG -= qt CONFIG += console DESTDIR = ./ -# no install rule for application used by test -INSTALLS = - - +# This app is testdata for tst_qprocess +target.path = $$[QT_INSTALL_TESTS]/tst_qprocess/$$TARGET +INSTALLS += target diff --git a/tests/auto/corelib/io/qprocess/testProcessSpacesArgs/nospace.pro b/tests/auto/corelib/io/qprocess/testProcessSpacesArgs/nospace.pro index f55f02e425..93d0afb79f 100644 --- a/tests/auto/corelib/io/qprocess/testProcessSpacesArgs/nospace.pro +++ b/tests/auto/corelib/io/qprocess/testProcessSpacesArgs/nospace.pro @@ -3,7 +3,6 @@ CONFIG -= qt app_bundle CONFIG += console DESTDIR = ./ -# no install rule for application used by test -INSTALLS = - - +# This app is testdata for tst_qproces +target.path = $$[QT_INSTALL_TESTS]/tst_qprocess/testProcessSpacesArgs +INSTALLS += target diff --git a/tests/auto/corelib/io/qprocess/testProcessSpacesArgs/onespace.pro b/tests/auto/corelib/io/qprocess/testProcessSpacesArgs/onespace.pro index 2a56a95606..f53e5790ea 100644 --- a/tests/auto/corelib/io/qprocess/testProcessSpacesArgs/onespace.pro +++ b/tests/auto/corelib/io/qprocess/testProcessSpacesArgs/onespace.pro @@ -3,9 +3,8 @@ CONFIG -= qt app_bundle CONFIG += console DESTDIR = ./ -TARGET = "one space" - -# no install rule for application used by test -INSTALLS = - +TARGET = one space +# This app is testdata for tst_qprocess +target.path = $$[QT_INSTALL_TESTS]/tst_qprocess/testProcessSpacesArgs +INSTALLS += target diff --git a/tests/auto/corelib/io/qprocess/testProcessSpacesArgs/twospaces.pro b/tests/auto/corelib/io/qprocess/testProcessSpacesArgs/twospaces.pro index d7c74a64c9..a4ee0cfd83 100644 --- a/tests/auto/corelib/io/qprocess/testProcessSpacesArgs/twospaces.pro +++ b/tests/auto/corelib/io/qprocess/testProcessSpacesArgs/twospaces.pro @@ -3,10 +3,8 @@ CONFIG -= qt app_bundle CONFIG += console DESTDIR = ./ -TARGET = "two space s" - -# no install rule for application used by test -INSTALLS = - - +TARGET = two space s +# This app is testdata for tst_qprocess +target.path = $$[QT_INSTALL_TESTS]/tst_qprocess/testProcessSpacesArgs +INSTALLS += target diff --git a/tests/auto/corelib/io/qprocess/testSetWorkingDirectory/testSetWorkingDirectory.pro b/tests/auto/corelib/io/qprocess/testSetWorkingDirectory/testSetWorkingDirectory.pro index b723604171..d6cc96b1e8 100644 --- a/tests/auto/corelib/io/qprocess/testSetWorkingDirectory/testSetWorkingDirectory.pro +++ b/tests/auto/corelib/io/qprocess/testSetWorkingDirectory/testSetWorkingDirectory.pro @@ -2,6 +2,6 @@ SOURCES = main.cpp CONFIG += console DESTDIR = ./ -# no install rule for application used by test -INSTALLS = - +# This app is testdata for tst_qprocess +target.path = $$[QT_INSTALL_TESTS]/tst_qprocess/$$TARGET +INSTALLS += target diff --git a/tests/auto/corelib/io/qprocess/testSoftExit/testSoftExit.pro b/tests/auto/corelib/io/qprocess/testSoftExit/testSoftExit.pro index 922035907a..5d4ec4fc21 100644 --- a/tests/auto/corelib/io/qprocess/testSoftExit/testSoftExit.pro +++ b/tests/auto/corelib/io/qprocess/testSoftExit/testSoftExit.pro @@ -10,7 +10,6 @@ CONFIG -= qt app_bundle CONFIG += console DESTDIR = ./ -# no install rule for application used by test -INSTALLS = - - +# This app is testdata for tst_qprocess +target.path = $$[QT_INSTALL_TESTS]/tst_qprocess/$$TARGET +INSTALLS += target diff --git a/tests/auto/corelib/io/qprocess/testSpaceInName/testSpaceInName.pro b/tests/auto/corelib/io/qprocess/testSpaceInName/testSpaceInName.pro index 913e868d03..eac0b59d9a 100644 --- a/tests/auto/corelib/io/qprocess/testSpaceInName/testSpaceInName.pro +++ b/tests/auto/corelib/io/qprocess/testSpaceInName/testSpaceInName.pro @@ -7,7 +7,6 @@ mac { CONFIG -= app_bundle } -# no install rule for application used by test -INSTALLS = - - +# This app is testdata for tst_qprocess +target.path = "$$[QT_INSTALL_TESTS]/tst_qprocess/test Space In Name" +INSTALLS += target diff --git a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp index 32cd6b7266..f5754c07aa 100644 --- a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp +++ b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp @@ -73,10 +73,9 @@ class tst_QProcess : public QObject { Q_OBJECT -#ifdef QT_NO_PROCESS public slots: void initTestCase(); -#else +#ifndef QT_NO_PROCESS private slots: void getSetCheck(); void constructing(); @@ -166,13 +165,18 @@ private: #endif }; -#ifdef QT_NO_PROCESS void tst_QProcess::initTestCase() { +#ifdef QT_NO_PROCESS QSKIP("This test requires QProcess support"); +#else + // chdir to our testdata path and execute helper apps relative to that. + QString testdata_dir = QFileInfo(QFINDTESTDATA("testProcessNormal")).absolutePath(); + QVERIFY2(QDir::setCurrent(testdata_dir), qPrintable("Could not chdir to " + testdata_dir)); +#endif } -#else +#ifndef QT_NO_PROCESS // Testing get/set functions void tst_QProcess::getSetCheck() |