diff options
Diffstat (limited to 'tests/auto/corelib/thread/qthreadstorage')
3 files changed, 22 insertions, 27 deletions
diff --git a/tests/auto/corelib/thread/qthreadstorage/crashonexit/crashonexit.pro b/tests/auto/corelib/thread/qthreadstorage/crashonexit/crashonexit.pro index 94a0a01e94..d5c09ebc84 100644 --- a/tests/auto/corelib/thread/qthreadstorage/crashonexit/crashonexit.pro +++ b/tests/auto/corelib/thread/qthreadstorage/crashonexit/crashonexit.pro @@ -1,5 +1,13 @@ SOURCES += crashOnExit.cpp -DESTDIR = ./ +debug_and_release { + CONFIG(debug, debug|release) { + TARGET = ../../debug/crashOnExit_helper + } else { + TARGET = ../../release/crashOnExit_helper + } +} else { + TARGET = ../crashOnExit_helper +} QT = core CONFIG -= app_bundle CONFIG += console diff --git a/tests/auto/corelib/thread/qthreadstorage/test/test.pro b/tests/auto/corelib/thread/qthreadstorage/test/test.pro index d7190f7e7b..d2f21f48f0 100644 --- a/tests/auto/corelib/thread/qthreadstorage/test/test.pro +++ b/tests/auto/corelib/thread/qthreadstorage/test/test.pro @@ -1,9 +1,16 @@ CONFIG += testcase -TARGET = ../tst_qthreadstorage -CONFIG -= debug_and_release_target +debug_and_release { + CONFIG(debug, debug|release) { + TARGET = ../../debug/tst_qthreadstorage + !android:!winrt: TEST_HELPER_INSTALLS = ../../debug/crashonexit_helper + } else { + TARGET = ../../release/tst_qthreadstorage + !android:!winrt: TEST_HELPER_INSTALLS = ../../release/crashonexit_helper + } +} else { + TARGET = ../tst_qthreadstorage + !android:!winrt: TEST_HELPER_INSTALLS = ../crashonexit_helper +} CONFIG += console QT = core testlib SOURCES = ../tst_qthreadstorage.cpp - -!android:!winrt: TEST_HELPER_INSTALLS = ../crashonexit/crashonexit - diff --git a/tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp b/tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp index 403e28b07b..ef5d3452d5 100644 --- a/tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp +++ b/tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp @@ -48,7 +48,6 @@ class tst_QThreadStorage : public QObject { Q_OBJECT private slots: - void initTestCase(); void hasLocalData(); void localData(); void localData_const(); @@ -60,9 +59,6 @@ private slots: void leakInDestructor(); void resetInDestructor(); void valueBased(); - -private: - QString m_crashOnExit; }; class Pointer @@ -74,22 +70,6 @@ public: }; int Pointer::count = 0; -void tst_QThreadStorage::initTestCase() -{ -#if QT_CONFIG(process) - const QString crashOnExitDir = QFINDTESTDATA("crashonexit"); - QVERIFY2(!crashOnExitDir.isEmpty(), - qPrintable(QString::fromLatin1("Could not find 'crashonexit' starting from '%1'") - .arg(QDir::toNativeSeparators(QDir::currentPath())))); - m_crashOnExit = crashOnExitDir + QStringLiteral("/crashonexit"); -#ifdef Q_OS_WIN - m_crashOnExit += QStringLiteral(".exe"); -#endif - QVERIFY2(QFileInfo(m_crashOnExit).isExecutable(), - qPrintable(QDir::toNativeSeparators(m_crashOnExit) + QStringLiteral(" does not exist or is not executable."))); -#endif -} - void tst_QThreadStorage::hasLocalData() { QThreadStorage<Pointer *> pointers; @@ -329,7 +309,7 @@ void tst_QThreadStorage::crashOnExit() QSKIP("No qprocess support", SkipAll); #else QString errorMessage; - QVERIFY2(runCrashOnExit(m_crashOnExit, &errorMessage), + QVERIFY2(runCrashOnExit("crashOnExit_helper", &errorMessage), qPrintable(errorMessage)); #endif } |