diff options
author | Samuli Piippo <samuli.piippo@qt.io> | 2021-02-11 10:51:55 +0200 |
---|---|---|
committer | Samuli Piippo <samuli.piippo@qt.io> | 2021-02-13 10:02:51 +0200 |
commit | 0ce443691fac1188103e5eaa66be40278d5d5e97 (patch) | |
tree | c3ab6b2ce3a667cabecec57222e1d624122144a7 /tests/auto/testlib | |
parent | 9585500539b3674296c61b884fe3f12363efb848 (diff) |
Move QEMU emulation detector to QTest
The emulation detection has been usable only on qtbase tests, move it to
QTest so that it can be used in other modules as well.
Pick-to: 6.1
Change-Id: I4b2321b7856414d7b1cfd5e6b1405a633c6bb878
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'tests/auto/testlib')
-rw-r--r-- | tests/auto/testlib/selftests/CMakeLists.txt | 3 | ||||
-rw-r--r-- | tests/auto/testlib/selftests/float/CMakeLists.txt | 4 | ||||
-rw-r--r-- | tests/auto/testlib/selftests/float/tst_float.cpp | 4 | ||||
-rw-r--r-- | tests/auto/testlib/selftests/tst_selftests.cpp | 6 |
4 files changed, 6 insertions, 11 deletions
diff --git a/tests/auto/testlib/selftests/CMakeLists.txt b/tests/auto/testlib/selftests/CMakeLists.txt index 7a352740da..ec321dc282 100644 --- a/tests/auto/testlib/selftests/CMakeLists.txt +++ b/tests/auto/testlib/selftests/CMakeLists.txt @@ -10,11 +10,8 @@ qt_internal_add_test(tst_selftests EXCEPTIONS CATCH SOURCES - ../../../shared/emulationdetector.h tst_selftests.cpp catch.cpp - INCLUDE_DIRECTORIES - ../../../shared PUBLIC_LIBRARIES Qt::TestPrivate # special case begin diff --git a/tests/auto/testlib/selftests/float/CMakeLists.txt b/tests/auto/testlib/selftests/float/CMakeLists.txt index 375cfe1e65..02c61acff3 100644 --- a/tests/auto/testlib/selftests/float/CMakeLists.txt +++ b/tests/auto/testlib/selftests/float/CMakeLists.txt @@ -8,12 +8,10 @@ qt_internal_add_executable(float NO_INSTALL # special case OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case SOURCES - ../../../../shared/emulationdetector.h tst_float.cpp - INCLUDE_DIRECTORIES - ../../../../shared PUBLIC_LIBRARIES Qt::Test + Qt::TestPrivate ) ## Scopes: diff --git a/tests/auto/testlib/selftests/float/tst_float.cpp b/tests/auto/testlib/selftests/float/tst_float.cpp index 97b76ccf47..6084b464e2 100644 --- a/tests/auto/testlib/selftests/float/tst_float.cpp +++ b/tests/auto/testlib/selftests/float/tst_float.cpp @@ -31,7 +31,7 @@ #include <QTest> #include <QDebug> -#include "emulationdetector.h" +#include <QtTest/private/qemulationdetector_p.h> // Test proper handling of floating-point types class tst_float: public QObject @@ -182,7 +182,7 @@ void tst_float::float16Comparisons_data() const QTest::addColumn<qfloat16>("operandLeft"); QTest::addColumn<qfloat16>("operandRight"); const qfloat16 zero(0), one(1); - const qfloat16 tiny(EmulationDetector::isRunningArmOnX86() ? 0.00099f : 0.001f); + const qfloat16 tiny(QTestPrivate::isRunningArmOnX86() ? 0.00099f : 0.001f); QTest::newRow("should FAIL 1") << one << qfloat16(3); QTest::newRow("should PASS 1") << zero << zero; diff --git a/tests/auto/testlib/selftests/tst_selftests.cpp b/tests/auto/testlib/selftests/tst_selftests.cpp index 4c5e56b97b..1b1ad50e9b 100644 --- a/tests/auto/testlib/selftests/tst_selftests.cpp +++ b/tests/auto/testlib/selftests/tst_selftests.cpp @@ -48,7 +48,7 @@ #include <private/cycle_p.h> -#include "emulationdetector.h" +#include <QtTest/private/qemulationdetector_p.h> struct BenchmarkResult { @@ -345,7 +345,7 @@ bool compareLine(const QString &logger, const QString &subdir, return true; } - if (EmulationDetector::isRunningArmOnX86() && subdir == QLatin1String("float")) { + if (QTestPrivate::isRunningArmOnX86() && subdir == QLatin1String("float")) { // QEMU cheats at qfloat16, so outputs it as if it were a float. if (actualLine.endsWith(QLatin1String("Actual (operandLeft) : 0.001")) && expectedLine.endsWith(QLatin1String("Actual (operandLeft) : 0.000999"))) { @@ -787,7 +787,7 @@ void checkErrorOutput(const QString &test, const QByteArray &errorOutput) #ifdef Q_OS_LINUX // QEMU outputs to stderr about uncaught signals - if (EmulationDetector::isRunningArmOnX86() && + if (QTestPrivate::isRunningArmOnX86() && (test == "assert" || test == "blacklisted" || test == "crashes" |