diff options
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/corelib/io/qfile/.gitignore | 8 | ||||
-rw-r--r-- | tests/auto/corelib/io/qfile/stdinprocess/main.cpp | 2 | ||||
-rw-r--r-- | tests/auto/corelib/io/qfile/stdinprocess/stdinprocess.pro | 12 | ||||
-rw-r--r-- | tests/auto/corelib/io/qfile/test/test.pro | 11 | ||||
-rw-r--r-- | tests/auto/corelib/io/qfile/tst_qfile.cpp | 16 |
5 files changed, 37 insertions, 12 deletions
diff --git a/tests/auto/corelib/io/qfile/.gitignore b/tests/auto/corelib/io/qfile/.gitignore index c508239722..615264e4d4 100644 --- a/tests/auto/corelib/io/qfile/.gitignore +++ b/tests/auto/corelib/io/qfile/.gitignore @@ -1,6 +1,10 @@ tst_qfile -stdinprocess/stdinprocess -stdinprocess/stdinprocess.exe +stdinprocess_helper +stdinprocess_helper.exe +debug/stdinprocess_helper +debug/stdinprocess_helper.exe +release/stdinprocess_helper +release/stdinprocess_helper.exe readonlyfile newfile.txt appendfile.txt diff --git a/tests/auto/corelib/io/qfile/stdinprocess/main.cpp b/tests/auto/corelib/io/qfile/stdinprocess/main.cpp index 6ff42c2485..77a1932bd5 100644 --- a/tests/auto/corelib/io/qfile/stdinprocess/main.cpp +++ b/tests/auto/corelib/io/qfile/stdinprocess/main.cpp @@ -33,7 +33,7 @@ int main(int argc, char *argv[]) { if (argc < 2) { - printf("usage: stdinprocess <all|line <0|1>>\n"); + printf("usage: stdinprocess_helper <all|line <0|1>>\n"); printf("echos all its input to its output.\n"); return 1; } diff --git a/tests/auto/corelib/io/qfile/stdinprocess/stdinprocess.pro b/tests/auto/corelib/io/qfile/stdinprocess/stdinprocess.pro index 8e463e4cef..4029701943 100644 --- a/tests/auto/corelib/io/qfile/stdinprocess/stdinprocess.pro +++ b/tests/auto/corelib/io/qfile/stdinprocess/stdinprocess.pro @@ -1,8 +1,18 @@ SOURCES += main.cpp QT = core -CONFIG -= app_bundle debug_and_release_target +CONFIG -= app_bundle CONFIG += console +debug_and_release { + CONFIG(debug, debug|release) { + TARGET = ../../debug/stdinprocess_helper + } else { + TARGET = ../../release/stdinprocess_helper + } +} else { + TARGET = ../stdinprocess_helper +} + # This app is testdata for tst_qfile target.path = $$[QT_INSTALL_TESTS]/tst_qfile/$$TARGET INSTALLS += target diff --git a/tests/auto/corelib/io/qfile/test/test.pro b/tests/auto/corelib/io/qfile/test/test.pro index 1472ddbb83..7b952b0283 100644 --- a/tests/auto/corelib/io/qfile/test/test.pro +++ b/tests/auto/corelib/io/qfile/test/test.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG -= debug_and_release_target QT = core-private core testlib qtHaveModule(network): QT += network else: DEFINES += QT_NO_NETWORK @@ -10,7 +9,15 @@ contains(CONFIG, builtin_testdata) { TESTDATA += ../BLACKLIST -TARGET = ../tst_qfile +debug_and_release { + CONFIG(debug, debug|release) { + TARGET = ../../debug/tst_qfile + } else { + TARGET = ../../release/tst_qfile + } +} else { + TARGET = ../tst_qfile +} SOURCES = ../tst_qfile.cpp INCLUDEPATH += ../../../../../shared/ HEADERS += ../../../../../shared/emulationdetector.h diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp index ad00e25e7d..a61b7cc573 100644 --- a/tests/auto/corelib/io/qfile/tst_qfile.cpp +++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp @@ -361,7 +361,7 @@ private: QTemporaryDir m_temporaryDir; const QString m_oldDir; - QString m_stdinProcessDir; + QString m_stdinProcess; QString m_testSourceFile; QString m_testLogFile; QString m_dosFile; @@ -442,8 +442,12 @@ void tst_QFile::initTestCase() { QVERIFY2(m_temporaryDir.isValid(), qPrintable(m_temporaryDir.errorString())); #if QT_CONFIG(process) - m_stdinProcessDir = QFINDTESTDATA("stdinprocess"); - QVERIFY(!m_stdinProcessDir.isEmpty()); +#ifndef Q_OS_WIN + m_stdinProcess = QFINDTESTDATA("stdinprocess_helper"); +#else + m_stdinProcess = QFINDTESTDATA("stdinprocess_helper.exe"); +#endif + QVERIFY(!m_stdinProcess.isEmpty()); #endif m_testLogFile = QFINDTESTDATA("testlog.txt"); QVERIFY(!m_testLogFile.isEmpty()); @@ -962,7 +966,7 @@ void tst_QFile::readAllStdin() QProcess process; StdinReaderProcessGuard processGuard(&process); - process.start(m_stdinProcessDir + QStringLiteral("/stdinprocess"), QStringList(QStringLiteral("all"))); + process.start(m_stdinProcess, QStringList(QStringLiteral("all"))); QVERIFY2(process.waitForStarted(), qPrintable(process.errorString())); for (int i = 0; i < 5; ++i) { QTest::qWait(1000); @@ -992,7 +996,7 @@ void tst_QFile::readLineStdin() for (int i = 0; i < 2; ++i) { QProcess process; StdinReaderProcessGuard processGuard(&process); - process.start(m_stdinProcessDir + QStringLiteral("/stdinprocess"), + process.start(m_stdinProcess, QStringList() << QStringLiteral("line") << QString::number(i), QIODevice::Text | QIODevice::ReadWrite); QVERIFY2(process.waitForStarted(), qPrintable(process.errorString())); @@ -1025,7 +1029,7 @@ void tst_QFile::readLineStdin_lineByLine() for (int i = 0; i < 2; ++i) { QProcess process; StdinReaderProcessGuard processGuard(&process); - process.start(m_stdinProcessDir + QStringLiteral("/stdinprocess"), + process.start(m_stdinProcess, QStringList() << QStringLiteral("line") << QString::number(i), QIODevice::Text | QIODevice::ReadWrite); QVERIFY2(process.waitForStarted(), qPrintable(process.errorString())); |