summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/io
diff options
context:
space:
mode:
authorSamuli Piippo <samuli.piippo@qt.io>2021-02-11 10:51:55 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-02-13 10:14:16 +0000
commit83dcbf75ad232421070fbe1b461c54b5ffe9783d (patch)
tree1279dade2c2e94277bc34e1557b40786a180ad52 /tests/auto/corelib/io
parent1c0073ba72f92ba96db05230d1c8e896cc85c821 (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. Change-Id: I4b2321b7856414d7b1cfd5e6b1405a633c6bb878 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 0ce443691fac1188103e5eaa66be40278d5d5e97) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests/auto/corelib/io')
-rw-r--r--tests/auto/corelib/io/largefile/CMakeLists.txt5
-rw-r--r--tests/auto/corelib/io/largefile/tst_largefile.cpp4
-rw-r--r--tests/auto/corelib/io/qfile/CMakeLists.txt4
-rw-r--r--tests/auto/corelib/io/qfile/tst_qfile.cpp6
-rw-r--r--tests/auto/corelib/io/qprocess/test/CMakeLists.txt4
-rw-r--r--tests/auto/corelib/io/qprocess/tst_qprocess.cpp5
6 files changed, 11 insertions, 17 deletions
diff --git a/tests/auto/corelib/io/largefile/CMakeLists.txt b/tests/auto/corelib/io/largefile/CMakeLists.txt
index be4b21033f..a82aa0c985 100644
--- a/tests/auto/corelib/io/largefile/CMakeLists.txt
+++ b/tests/auto/corelib/io/largefile/CMakeLists.txt
@@ -6,8 +6,7 @@
qt_internal_add_test(tst_largefile
SOURCES
- ../../../../shared/emulationdetector.h
tst_largefile.cpp
- INCLUDE_DIRECTORIES
- ../../../../shared
+ PUBLIC_LIBRARIES
+ Qt::TestPrivate
)
diff --git a/tests/auto/corelib/io/largefile/tst_largefile.cpp b/tests/auto/corelib/io/largefile/tst_largefile.cpp
index 98bb985c02..fcc0a31763 100644
--- a/tests/auto/corelib/io/largefile/tst_largefile.cpp
+++ b/tests/auto/corelib/io/largefile/tst_largefile.cpp
@@ -48,7 +48,7 @@
# endif
#endif // Q_OS_WIN
-#include "emulationdetector.h"
+#include <QtTest/private/qemulationdetector_p.h>
class tst_LargeFile
: public QObject
@@ -73,7 +73,7 @@ public:
#endif
// QEMU only supports < 4GB files
- if (EmulationDetector::isRunningArmOnX86())
+ if (QTestPrivate::isRunningArmOnX86())
maxSizeBits = qMin(maxSizeBits, 28);
}
diff --git a/tests/auto/corelib/io/qfile/CMakeLists.txt b/tests/auto/corelib/io/qfile/CMakeLists.txt
index 7a0102bfd9..4d9a0d2598 100644
--- a/tests/auto/corelib/io/qfile/CMakeLists.txt
+++ b/tests/auto/corelib/io/qfile/CMakeLists.txt
@@ -19,12 +19,10 @@ list(APPEND test_data "resources/file1.ext1")
qt_internal_add_test(tst_qfile
SOURCES
- ../../../../shared/emulationdetector.h
tst_qfile.cpp
- INCLUDE_DIRECTORIES
- ../../../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
+ Qt::TestPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp
index 2019afaf66..bdfcc2d350 100644
--- a/tests/auto/corelib/io/qfile/tst_qfile.cpp
+++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp
@@ -46,7 +46,7 @@
#include <private/qfsfileengine_p.h>
#include <private/qfilesystemengine_p.h>
-#include "emulationdetector.h"
+#include <QtTest/private/qemulationdetector_p.h>
#ifdef Q_OS_WIN
QT_BEGIN_NAMESPACE
@@ -2553,10 +2553,10 @@ void tst_QFile::virtualFile()
// open the file
QFile f(fname);
QVERIFY2(f.open(QIODevice::ReadOnly), msgOpenFailed(f).constData());
- if (EmulationDetector::isRunningArmOnX86())
+ if (QTestPrivate::isRunningArmOnX86())
QEXPECT_FAIL("","QEMU does not read /proc/self/maps size correctly", Continue);
QCOMPARE(f.size(), Q_INT64_C(0));
- if (EmulationDetector::isRunningArmOnX86())
+ if (QTestPrivate::isRunningArmOnX86())
QEXPECT_FAIL("","QEMU does not read /proc/self/maps size correctly", Continue);
QVERIFY(f.atEnd());
diff --git a/tests/auto/corelib/io/qprocess/test/CMakeLists.txt b/tests/auto/corelib/io/qprocess/test/CMakeLists.txt
index 249cb089cf..75cddf41a8 100644
--- a/tests/auto/corelib/io/qprocess/test/CMakeLists.txt
+++ b/tests/auto/corelib/io/qprocess/test/CMakeLists.txt
@@ -7,13 +7,11 @@
qt_internal_add_test(tst_qprocess
OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../"
SOURCES
- ../../../../../shared/emulationdetector.h
../tst_qprocess.cpp
- INCLUDE_DIRECTORIES
- ../../../../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Network
+ Qt::TestPrivate
)
#### Keys ignored in scope 1:.:.:test.pro:<TRUE>:
diff --git a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp
index b6ba4e546c..41172a10dd 100644
--- a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp
+++ b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp
@@ -27,11 +27,10 @@
**
****************************************************************************/
-#include <emulationdetector.h>
-
#include <QTest>
#include <QTestEventLoop>
#include <QSignalSpy>
+#include <QtTest/private/qemulationdetector_p.h>
#include <QtCore/QProcess>
#include <QtCore/QDir>
@@ -1237,7 +1236,7 @@ void tst_QProcess::processInAThread()
void tst_QProcess::processesInMultipleThreads()
{
- if (EmulationDetector::isRunningArmOnX86())
+ if (QTestPrivate::isRunningArmOnX86())
QSKIP("Flakily hangs in QEMU. QTBUG-67760");
for (int i = 0; i < 10; ++i) {
// run from 1 to 10 threads, but run at least some tests