diff options
Diffstat (limited to 'tests/auto/corelib/io')
53 files changed, 1094 insertions, 222 deletions
diff --git a/tests/auto/corelib/io/.prev_CMakeLists.txt b/tests/auto/corelib/io/.prev_CMakeLists.txt new file mode 100644 index 0000000000..5baf4c35de --- /dev/null +++ b/tests/auto/corelib/io/.prev_CMakeLists.txt @@ -0,0 +1,56 @@ +# Generated from io.pro. + +if(QT_FEATURE_private_tests) + add_subdirectory(qabstractfileengine) + add_subdirectory(qfileinfo) + add_subdirectory(qipaddress) + add_subdirectory(qloggingregistry) + add_subdirectory(qurlinternal) +endif() +add_subdirectory(qbuffer) +add_subdirectory(qdataurl) +add_subdirectory(qdiriterator) +add_subdirectory(qfile) +add_subdirectory(largefile) +add_subdirectory(qfileselector) +add_subdirectory(qfilesystemmetadata) +add_subdirectory(qloggingcategory) +add_subdirectory(qnodebug) +add_subdirectory(qsavefile) +add_subdirectory(qstandardpaths) +add_subdirectory(qtemporarydir) +add_subdirectory(qtemporaryfile) +add_subdirectory(qurlquery) +if(TARGET Qt::Concurrent) + add_subdirectory(qdebug) + add_subdirectory(qlockfile) + add_subdirectory(qurl) +endif() +if(NOT ANDROID) + add_subdirectory(qdir) + add_subdirectory(qresourceengine) +endif() +if(QT_FEATURE_private_tests OR UNIX) + add_subdirectory(qfilesystementry) +endif() +if(QT_FEATURE_filesystemwatcher) + add_subdirectory(qfilesystemwatcher) +endif() +if(TARGET Qt::Network) + add_subdirectory(qiodevice) +endif() +if(QT_FEATURE_process AND TARGET Qt::Network AND NOT ANDROID) + add_subdirectory(qprocess) +endif() +if(QT_FEATURE_process) + add_subdirectory(qprocess-noapplication) +endif() +if(QT_FEATURE_processenvironment) + add_subdirectory(qprocessenvironment) +endif() +if(QT_FEATURE_settings AND TARGET Qt::Gui) + add_subdirectory(qsettings) +endif() +if(NOT WINRT) + add_subdirectory(qstorageinfo) +endif() diff --git a/tests/auto/corelib/io/CMakeLists.txt b/tests/auto/corelib/io/CMakeLists.txt new file mode 100644 index 0000000000..cb1246c3a2 --- /dev/null +++ b/tests/auto/corelib/io/CMakeLists.txt @@ -0,0 +1,56 @@ +# Generated from io.pro. + +if(QT_FEATURE_private_tests) + add_subdirectory(qabstractfileengine) + add_subdirectory(qfileinfo) + add_subdirectory(qipaddress) + add_subdirectory(qloggingregistry) + add_subdirectory(qurlinternal) +endif() +add_subdirectory(qbuffer) +add_subdirectory(qdataurl) +add_subdirectory(qdiriterator) +add_subdirectory(qfile) +add_subdirectory(largefile) +# add_subdirectory(qfileselector) # special case needs fixes +add_subdirectory(qfilesystemmetadata) +add_subdirectory(qloggingcategory) +add_subdirectory(qnodebug) +add_subdirectory(qsavefile) +add_subdirectory(qstandardpaths) +add_subdirectory(qtemporarydir) +add_subdirectory(qtemporaryfile) +add_subdirectory(qurlquery) +if(TARGET Qt::Concurrent) + add_subdirectory(qdebug) + add_subdirectory(qlockfile) + add_subdirectory(qurl) +endif() +if(NOT ANDROID) + add_subdirectory(qdir) + # add_subdirectory(qresourceengine) # special case needs fixes +endif() +if(QT_FEATURE_private_tests OR UNIX) + add_subdirectory(qfilesystementry) +endif() +if(QT_FEATURE_filesystemwatcher) + add_subdirectory(qfilesystemwatcher) +endif() +if(TARGET Qt::Network) + add_subdirectory(qiodevice) +endif() +if(QT_FEATURE_process AND TARGET Qt::Network AND NOT ANDROID) + # add_subdirectory(qprocess) # special case needs fixes +endif() +if(QT_FEATURE_process) + add_subdirectory(qprocess-noapplication) +endif() +if(QT_FEATURE_processenvironment) + add_subdirectory(qprocessenvironment) +endif() +if(QT_FEATURE_settings AND TARGET Qt::Gui) + add_subdirectory(qsettings) +endif() +if(NOT WINRT) + add_subdirectory(qstorageinfo) +endif() diff --git a/tests/auto/corelib/io/largefile/CMakeLists.txt b/tests/auto/corelib/io/largefile/CMakeLists.txt new file mode 100644 index 0000000000..cb1eba8526 --- /dev/null +++ b/tests/auto/corelib/io/largefile/CMakeLists.txt @@ -0,0 +1,13 @@ +# Generated from largefile.pro. + +##################################################################### +## tst_largefile Test: +##################################################################### + +add_qt_test(tst_largefile + SOURCES + ../../../../shared/emulationdetector.h + tst_largefile.cpp + INCLUDE_DIRECTORIES + ../../../../shared +) diff --git a/tests/auto/corelib/io/qabstractfileengine/CMakeLists.txt b/tests/auto/corelib/io/qabstractfileengine/CMakeLists.txt new file mode 100644 index 0000000000..1b7a11d657 --- /dev/null +++ b/tests/auto/corelib/io/qabstractfileengine/CMakeLists.txt @@ -0,0 +1,25 @@ +# Generated from qabstractfileengine.pro. + +##################################################################### +## tst_qabstractfileengine Test: +##################################################################### + +add_qt_test(tst_qabstractfileengine + SOURCES + tst_qabstractfileengine.cpp + PUBLIC_LIBRARIES + Qt::CorePrivate +) + +# Resources: +set(qabstractfileengine_resource_files + "resources/" +) + +add_qt_resource(tst_qabstractfileengine "qabstractfileengine" + PREFIX + "/tst_qabstractfileengine/" + FILES + ${qabstractfileengine_resource_files} +) + diff --git a/tests/auto/corelib/io/qbuffer/CMakeLists.txt b/tests/auto/corelib/io/qbuffer/CMakeLists.txt new file mode 100644 index 0000000000..40502dd004 --- /dev/null +++ b/tests/auto/corelib/io/qbuffer/CMakeLists.txt @@ -0,0 +1,10 @@ +# Generated from qbuffer.pro. + +##################################################################### +## tst_qbuffer Test: +##################################################################### + +add_qt_test(tst_qbuffer + SOURCES + tst_qbuffer.cpp +) diff --git a/tests/auto/corelib/io/qdataurl/CMakeLists.txt b/tests/auto/corelib/io/qdataurl/CMakeLists.txt new file mode 100644 index 0000000000..507852a11e --- /dev/null +++ b/tests/auto/corelib/io/qdataurl/CMakeLists.txt @@ -0,0 +1,12 @@ +# Generated from qdataurl.pro. + +##################################################################### +## tst_qdataurl Test: +##################################################################### + +add_qt_test(tst_qdataurl + SOURCES + tst_qdataurl.cpp + PUBLIC_LIBRARIES + Qt::CorePrivate +) diff --git a/tests/auto/corelib/io/qdebug/CMakeLists.txt b/tests/auto/corelib/io/qdebug/CMakeLists.txt new file mode 100644 index 0000000000..d7fa4fb7cd --- /dev/null +++ b/tests/auto/corelib/io/qdebug/CMakeLists.txt @@ -0,0 +1,12 @@ +# Generated from qdebug.pro. + +##################################################################### +## tst_qdebug Test: +##################################################################### + +add_qt_test(tst_qdebug + SOURCES + tst_qdebug.cpp + PUBLIC_LIBRARIES + Qt::Concurrent +) diff --git a/tests/auto/corelib/io/qdebug/tst_qdebug.cpp b/tests/auto/corelib/io/qdebug/tst_qdebug.cpp index 584e66a7db..7b9e614cf7 100644 --- a/tests/auto/corelib/io/qdebug/tst_qdebug.cpp +++ b/tests/auto/corelib/io/qdebug/tst_qdebug.cpp @@ -66,6 +66,7 @@ private slots: void resetFormat() const; void defaultMessagehandler() const; void threadSafety() const; + void toString() const; }; void tst_QDebug::assignment() const @@ -740,6 +741,28 @@ void tst_QDebug::threadSafety() const } } +void tst_QDebug::toString() const +{ + // By reference. + { + MyPoint point(3, 4); + QString expectedString; + QDebug stream(&expectedString); + stream << point; + QCOMPARE(QDebug::toString(point), expectedString); + } + + // By pointer. + { + QObject qobject; + qobject.setObjectName("test"); + QString expectedString; + QDebug stream(&expectedString); + stream << &qobject; + QCOMPARE(QDebug::toString(&qobject), expectedString); + } +} + // Should compile: instentiation of unrelated operator<< should not cause cause compilation // error in QDebug operators (QTBUG-47375) class TestClassA {}; diff --git a/tests/auto/corelib/io/qdir/CMakeLists.txt b/tests/auto/corelib/io/qdir/CMakeLists.txt new file mode 100644 index 0000000000..84136283c1 --- /dev/null +++ b/tests/auto/corelib/io/qdir/CMakeLists.txt @@ -0,0 +1,99 @@ +# Generated from qdir.pro. + +##################################################################### +## tst_qdir Test: +##################################################################### + +# Collect test data +list(APPEND test_data "testdir") +list(APPEND test_data "testData") +list(APPEND test_data "searchdir") +list(APPEND test_data "resources") +list(APPEND test_data "entrylist") +list(APPEND test_data "types") +list(APPEND test_data "tst_qdir.cpp") + +add_qt_test(tst_qdir + SOURCES + tst_qdir.cpp + PUBLIC_LIBRARIES + Qt::CorePrivate + TESTDATA ${test_data} +) + +# Resources: +set(qdir_resource_files + "resources/entryList/" +) + +add_qt_resource(tst_qdir "qdir" + PREFIX + "/tst_qdir/" + FILES + ${qdir_resource_files} +) + + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:qdir.pro:APPLE_IOS: +# QMAKE_INFO_PLIST = "Info.plist" + +extend_target(tst_qdir CONDITION CONFIG___contains___builtin_testdata + DEFINES + BUILTIN_TESTDATA +) + +if(ANDROID AND NOT ANDROID_EMBEDDED) + # Resources: + set(android_testdata_resource_files + "entrylist/directory/dummy" + "entrylist/file" + "resources/entryList/file1.data" + "resources/entryList/file2.data" + "resources/entryList/file3.data" + "resources/entryList/file4.nothing" + "searchdir/subdir1/picker.png" + "searchdir/subdir2/picker.png" + "testData/empty" + "testdir/dir/qdir.pro" + "testdir/dir/qrc_qdir.cpp" + "testdir/dir/tmp/empty" + "testdir/dir/tst_qdir.cpp" + "testdir/spaces/foo. bar" + "testdir/spaces/foo.bar" + "tst_qdir.cpp" + "types/a" + "types/a.a" + "types/a.b" + "types/a.c" + "types/b" + "types/b.a" + "types/b.b" + "types/b.c" + "types/c" + "types/c.a" + "types/c.b" + "types/c.c" + "types/d.a/dummy" + "types/d.b/dummy" + "types/d.c/dummy" + "types/d/dummy" + "types/e.a/dummy" + "types/e.b/dummy" + "types/e.c/dummy" + "types/e/dummy" + "types/f.a/dummy" + "types/f.b/dummy" + "types/f.c/dummy" + "types/f/dummy" + ) + + add_qt_resource(tst_qdir "android_testdata" + PREFIX + "/android_testdata" + FILES + ${android_testdata_resource_files} + ) +endif() diff --git a/tests/auto/corelib/io/qdir/testdir/dir/CMakeLists.txt b/tests/auto/corelib/io/qdir/testdir/dir/CMakeLists.txt new file mode 100644 index 0000000000..e50fcb60ca --- /dev/null +++ b/tests/auto/corelib/io/qdir/testdir/dir/CMakeLists.txt @@ -0,0 +1,13 @@ +# Generated from qdir.pro. + +##################################################################### +## qdir Binary: +##################################################################### + +add_qt_executable(qdir + GUI + DEFINES + QT_DISABLE_DEPRECATED_BEFORE=0 + PUBLIC_LIBRARIES + Qt::Gui +) diff --git a/tests/auto/corelib/io/qdiriterator/CMakeLists.txt b/tests/auto/corelib/io/qdiriterator/CMakeLists.txt new file mode 100644 index 0000000000..2e120b4621 --- /dev/null +++ b/tests/auto/corelib/io/qdiriterator/CMakeLists.txt @@ -0,0 +1,38 @@ +# Generated from qdiriterator.pro. + +##################################################################### +## tst_qdiriterator Test: +##################################################################### + +# Collect test data +list(APPEND test_data "entrylist") + +add_qt_test(tst_qdiriterator + SOURCES + tst_qdiriterator.cpp + PUBLIC_LIBRARIES + Qt::CorePrivate + TESTDATA ${test_data} +) + +# Resources: +set(qdiriterator_resource_files + "entrylist/directory/dummy" + "entrylist/file" +) + +add_qt_resource(tst_qdiriterator "qdiriterator" + PREFIX + "/testdata/" + FILES + ${qdiriterator_resource_files} +) + + +## Scopes: +##################################################################### + +extend_target(tst_qdiriterator CONDITION CONFIG___contains___builtin_testdata + DEFINES + BUILTIN_TESTDATA +) diff --git a/tests/auto/corelib/io/qfile/.prev_CMakeLists.txt b/tests/auto/corelib/io/qfile/.prev_CMakeLists.txt new file mode 100644 index 0000000000..b976754629 --- /dev/null +++ b/tests/auto/corelib/io/qfile/.prev_CMakeLists.txt @@ -0,0 +1,89 @@ +# Generated from qfile.pro. + +##################################################################### +## tst_qfile Test: +##################################################################### + +# Collect test data +list(APPEND test_data "BLACKLIST") +list(APPEND test_data "dosfile.txt") +list(APPEND test_data "noendofline.txt") +list(APPEND test_data "testfile.txt") +list(APPEND test_data "testlog.txt") +list(APPEND test_data "two.dots.file") +list(APPEND test_data "tst_qfile.cpp") +list(APPEND test_data "Makefile") +list(APPEND test_data "forCopying.txt") +list(APPEND test_data "forRenaming.txt") +list(APPEND test_data "resources/file1.ext1") + +add_qt_test(tst_qfile + SOURCES + ../../../../shared/emulationdetector.h + tst_qfile.cpp + INCLUDE_DIRECTORIES + ../../../../shared + LIBRARIES + Qt::CorePrivate + TESTDATA ${test_data} +) + +# Resources: +set(qfile_resource_files + "resources/" +) + +add_qt_resource(tst_qfile "qfile" + PREFIX + "/tst_qfileinfo/" + FILES + ${qfile_resource_files} +) +set(rename-fallback_resource_files + "rename-fallback.qrc" +) + +add_qt_resource(tst_qfile "rename-fallback" + PREFIX + "/" + FILES + ${rename-fallback_resource_files} +) +set(copy-fallback_resource_files + "copy-fallback.qrc" +) + +add_qt_resource(tst_qfile "copy-fallback" + PREFIX + "/" + FILES + ${copy-fallback_resource_files} +) + + +## Scopes: +##################################################################### + +extend_target(tst_qfile CONDITION TARGET Qt::Network + PUBLIC_LIBRARIES + Qt::Network +) + +extend_target(tst_qfile CONDITION NOT TARGET Qt::Network + DEFINES + QT_NO_NETWORK +) + +extend_target(tst_qfile CONDITION CONFIG___contains___builtin_testdata + DEFINES + BUILTIN_TESTDATA +) + +extend_target(tst_qfile CONDITION WIN32 AND NOT WINRT + PUBLIC_LIBRARIES + ole32 + uuid +) +if(NOT WINRT) + add_subdirectory(stdinprocess) +endif() diff --git a/tests/auto/corelib/io/qfile/CMakeLists.txt b/tests/auto/corelib/io/qfile/CMakeLists.txt new file mode 100644 index 0000000000..03b648d76f --- /dev/null +++ b/tests/auto/corelib/io/qfile/CMakeLists.txt @@ -0,0 +1,89 @@ +# Generated from qfile.pro. + +##################################################################### +## tst_qfile Test: +##################################################################### + +# Collect test data +# list(APPEND test_data "BLACKLIST") # special case remove +list(APPEND test_data "dosfile.txt") +list(APPEND test_data "noendofline.txt") +list(APPEND test_data "testfile.txt") +list(APPEND test_data "testlog.txt") +list(APPEND test_data "two.dots.file") +list(APPEND test_data "tst_qfile.cpp") +# list(APPEND test_data "Makefile") # special case remove +list(APPEND test_data "forCopying.txt") +list(APPEND test_data "forRenaming.txt") +list(APPEND test_data "resources/file1.ext1") + +add_qt_test(tst_qfile + SOURCES + ../../../../shared/emulationdetector.h + tst_qfile.cpp + INCLUDE_DIRECTORIES + ../../../../shared + LIBRARIES + Qt::CorePrivate + TESTDATA ${test_data} +) + +# Resources: +set(qfile_resource_files + "resources/" +) + +add_qt_resource(tst_qfile "qfile" + PREFIX + "/tst_qfileinfo/" + FILES + ${qfile_resource_files} +) +set(rename-fallback_resource_files + "rename-fallback.qrc" +) + +add_qt_resource(tst_qfile "rename-fallback" + PREFIX + "/" + FILES + ${rename-fallback_resource_files} +) +set(copy-fallback_resource_files + "copy-fallback.qrc" +) + +add_qt_resource(tst_qfile "copy-fallback" + PREFIX + "/" + FILES + ${copy-fallback_resource_files} +) + + +## Scopes: +##################################################################### + +extend_target(tst_qfile CONDITION TARGET Qt::Network + PUBLIC_LIBRARIES + Qt::Network +) + +extend_target(tst_qfile CONDITION NOT TARGET Qt::Network + DEFINES + QT_NO_NETWORK +) + +extend_target(tst_qfile CONDITION CONFIG___contains___builtin_testdata + DEFINES + BUILTIN_TESTDATA +) + +extend_target(tst_qfile CONDITION WIN32 AND NOT WINRT + PUBLIC_LIBRARIES + ole32 + uuid +) +if(NOT WINRT) + add_subdirectory(stdinprocess) +endif() diff --git a/tests/auto/corelib/io/qfile/stdinprocess/CMakeLists.txt b/tests/auto/corelib/io/qfile/stdinprocess/CMakeLists.txt new file mode 100644 index 0000000000..994c2fc268 --- /dev/null +++ b/tests/auto/corelib/io/qfile/stdinprocess/CMakeLists.txt @@ -0,0 +1,10 @@ +# Generated from stdinprocess.pro. + +##################################################################### +## stdinprocess_helper Binary: +##################################################################### + +add_qt_test_helper(stdinprocess_helper + SOURCES + main.cpp +) diff --git a/tests/auto/corelib/io/qfileinfo/CMakeLists.txt b/tests/auto/corelib/io/qfileinfo/CMakeLists.txt new file mode 100644 index 0000000000..a6cf3a38f1 --- /dev/null +++ b/tests/auto/corelib/io/qfileinfo/CMakeLists.txt @@ -0,0 +1,47 @@ +# Generated from qfileinfo.pro. + +##################################################################### +## tst_qfileinfo Test: +##################################################################### + +add_qt_test(tst_qfileinfo + SOURCES + tst_qfileinfo.cpp + PUBLIC_LIBRARIES + Qt::CorePrivate +) + +# Resources: +set(qfileinfo_resource_files + "resources/" +) + +add_qt_resource(tst_qfileinfo "qfileinfo" + PREFIX + "/tst_qfileinfo/" + FILES + ${qfileinfo_resource_files} +) +set(testdata_resource_files + "resources/file1" + "resources/file1.ext1" + "resources/file1.ext1.ext2" + "tst_qfileinfo.cpp" +) + +add_qt_resource(tst_qfileinfo "testdata" + PREFIX + "/testdata" + FILES + ${testdata_resource_files} +) + + +## Scopes: +##################################################################### + +extend_target(tst_qfileinfo CONDITION WIN32 AND NOT WINRT + PUBLIC_LIBRARIES + advapi32 + netapi32 +) diff --git a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp index 09ef0ea44f..ebb9a0a44c 100644 --- a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp +++ b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp @@ -116,7 +116,7 @@ static DWORD createSymbolicLink(const QString &symLinkName, const QString &targe reinterpret_cast<const wchar_t*>(nativeTarget.utf16()), flags) == FALSE) { result = GetLastError(); QTextStream(errorMessage) << "CreateSymbolicLink(" << nativeSymLinkName << ", " - << nativeTarget << ", 0x" << hex << flags << dec << ") failed with error " << result + << nativeTarget << ", 0x" << Qt::hex << flags << Qt::dec << ") failed with error " << result << ": " << qt_error_string(int(result)); } return result; diff --git a/tests/auto/corelib/io/qfileselector/platforms/+mac/test5 b/tests/auto/corelib/io/qfileselector/platforms/+mac/test5 deleted file mode 100644 index e69de29bb2..0000000000 --- a/tests/auto/corelib/io/qfileselector/platforms/+mac/test5 +++ /dev/null diff --git a/tests/auto/corelib/io/qfileselector/platforms/+osx/test4 b/tests/auto/corelib/io/qfileselector/platforms/+osx/test4 deleted file mode 100644 index e69de29bb2..0000000000 --- a/tests/auto/corelib/io/qfileselector/platforms/+osx/test4 +++ /dev/null diff --git a/tests/auto/corelib/io/qfileselector/platforms/+mac/test b/tests/auto/corelib/io/qfileselector/platforms/+unix/+darwin/+ios/test index e69de29bb2..e69de29bb2 100644 --- a/tests/auto/corelib/io/qfileselector/platforms/+mac/test +++ b/tests/auto/corelib/io/qfileselector/platforms/+unix/+darwin/+ios/test diff --git a/tests/auto/corelib/io/qfileselector/platforms/+unix/+darwin/+mac/+ios/test b/tests/auto/corelib/io/qfileselector/platforms/+unix/+darwin/+mac/+ios/test deleted file mode 100644 index e69de29bb2..0000000000 --- a/tests/auto/corelib/io/qfileselector/platforms/+unix/+darwin/+mac/+ios/test +++ /dev/null diff --git a/tests/auto/corelib/io/qfileselector/platforms/+unix/+darwin/+mac/+macos/test b/tests/auto/corelib/io/qfileselector/platforms/+unix/+darwin/+mac/+macos/test deleted file mode 100644 index e69de29bb2..0000000000 --- a/tests/auto/corelib/io/qfileselector/platforms/+unix/+darwin/+mac/+macos/test +++ /dev/null diff --git a/tests/auto/corelib/io/qfileselector/platforms/+unix/+darwin/+mac/+osx/+macos/test b/tests/auto/corelib/io/qfileselector/platforms/+unix/+darwin/+mac/+osx/+macos/test deleted file mode 100644 index e69de29bb2..0000000000 --- a/tests/auto/corelib/io/qfileselector/platforms/+unix/+darwin/+mac/+osx/+macos/test +++ /dev/null diff --git a/tests/auto/corelib/io/qfileselector/platforms/+unix/+darwin/+mac/+osx/test b/tests/auto/corelib/io/qfileselector/platforms/+unix/+darwin/+mac/+osx/test deleted file mode 100644 index e69de29bb2..0000000000 --- a/tests/auto/corelib/io/qfileselector/platforms/+unix/+darwin/+mac/+osx/test +++ /dev/null diff --git a/tests/auto/corelib/io/qfileselector/platforms/+unix/+darwin/+mac/test b/tests/auto/corelib/io/qfileselector/platforms/+unix/+darwin/+mac/test deleted file mode 100644 index e69de29bb2..0000000000 --- a/tests/auto/corelib/io/qfileselector/platforms/+unix/+darwin/+mac/test +++ /dev/null diff --git a/tests/auto/corelib/io/qfileselector/platforms/+osx/test b/tests/auto/corelib/io/qfileselector/platforms/+unix/+darwin/+macos/test index e69de29bb2..e69de29bb2 100644 --- a/tests/auto/corelib/io/qfileselector/platforms/+osx/test +++ b/tests/auto/corelib/io/qfileselector/platforms/+unix/+darwin/+macos/test diff --git a/tests/auto/corelib/io/qfileselector/qfileselector.qrc b/tests/auto/corelib/io/qfileselector/qfileselector.qrc index 54b2e0a0e2..f3b3ede575 100644 --- a/tests/auto/corelib/io/qfileselector/qfileselector.qrc +++ b/tests/auto/corelib/io/qfileselector/qfileselector.qrc @@ -1,65 +1,51 @@ -<!DOCTYPE RCC><RCC version="1.0"> -<qresource prefix="/"> - <file>extras/test</file> - <file>extras/test2</file> - <file>extras/+custom1/test</file> - <file>extras/+custom1/test3</file> - <file>extras/+custom2/test</file> - <file>extras/+custom3/test</file> - <file>extras/+custom3/+custom2/test</file> - <file>extras/+custom3/+custom4/test</file> - <file>extras/+custom3/+custom5/test</file> - <file>extras/+custom5/+custom3/test</file> - - <!-- platforms/test: deepest possible selection --> - <file>platforms/test</file> - <file>platforms/+unix/+android/test</file> - <file>platforms/+unix/+darwin/+mac/+ios/test</file> - <file>platforms/+unix/+darwin/+mac/+osx/+macos/test</file> - <file>platforms/+unix/+darwin/+mac/+osx/test</file> - <file>platforms/+unix/+darwin/+mac/test</file> - <file>platforms/+unix/+darwin/test</file> - <file>platforms/+unix/+haiku/test</file> - <file>platforms/+unix/+linux/test</file> - <file>platforms/+unix/+qnx/test</file> - <file>platforms/+unix/test</file> - <file>platforms/+windows/+wince/test</file> - <file>platforms/+windows/+winnt/test</file> - <file>platforms/+windows/+winrt/test</file> - <file>platforms/+windows/test</file> - <file>platforms/+android/test</file> - <file>platforms/+ios/test</file> - <file>platforms/+macos/test</file> - <file>platforms/+osx/test</file> - <file>platforms/+darwin/test</file> - <file>platforms/+mac/test</file> - <file>platforms/+haiku/test</file> - <file>platforms/+linux/test</file> - <file>platforms/+qnx/test</file> - <file>platforms/+wince/test</file> - <file>platforms/+winrt/test</file> - - <!-- platforms/test2: shallow selection for the deepest selector --> - <file>platforms/test2</file> - <file>platforms/+android/test2</file> - <file>platforms/+ios/test2</file> - <file>platforms/+macos/test2</file> - <file>platforms/+haiku/test2</file> - <file>platforms/+linux/test2</file> - <file>platforms/+qnx/test2</file> - <file>platforms/+wince/test2</file> - <file>platforms/+winnt/test2</file> - <file>platforms/+winrt/test2</file> - - <!-- platforms/test3: selection for the family only --> - <file>platforms/test3</file> - <file>platforms/+windows/test3</file> - <file>platforms/+unix/test3</file> - - <!-- platforms/test4 and 5: special cases for macOS --> - <file>platforms/test4</file> - <file>platforms/+osx/test4</file> - <file>platforms/test5</file> - <file>platforms/+mac/test5</file> -</qresource> +<RCC> + <qresource prefix="/"> + <file>extras/test</file> + <file>extras/test2</file> + <file>extras/+custom1/test</file> + <file>extras/+custom1/test3</file> + <file>extras/+custom2/test</file> + <file>extras/+custom3/test</file> + <file>extras/+custom3/+custom2/test</file> + <file>extras/+custom3/+custom4/test</file> + <file>extras/+custom3/+custom5/test</file> + <file>extras/+custom5/+custom3/test</file> + <file>platforms/test</file> + <file>platforms/+unix/+android/test</file> + <file>platforms/+unix/+darwin/test</file> + <file>platforms/+unix/+haiku/test</file> + <file>platforms/+unix/+linux/test</file> + <file>platforms/+unix/+qnx/test</file> + <file>platforms/+unix/test</file> + <file>platforms/+windows/+wince/test</file> + <file>platforms/+windows/+winnt/test</file> + <file>platforms/+windows/+winrt/test</file> + <file>platforms/+windows/test</file> + <file>platforms/+android/test</file> + <file>platforms/+ios/test</file> + <file>platforms/+macos/test</file> + <file>platforms/+darwin/test</file> + <file>platforms/+haiku/test</file> + <file>platforms/+linux/test</file> + <file>platforms/+qnx/test</file> + <file>platforms/+wince/test</file> + <file>platforms/+winrt/test</file> + <file>platforms/test2</file> + <file>platforms/+android/test2</file> + <file>platforms/+ios/test2</file> + <file>platforms/+macos/test2</file> + <file>platforms/+haiku/test2</file> + <file>platforms/+linux/test2</file> + <file>platforms/+qnx/test2</file> + <file>platforms/+wince/test2</file> + <file>platforms/+winnt/test2</file> + <file>platforms/+winrt/test2</file> + <file>platforms/test3</file> + <file>platforms/+windows/test3</file> + <file>platforms/+unix/test3</file> + <file>platforms/test4</file> + <file>platforms/test5</file> + <file>platforms/+unix/+darwin/+macos/test</file> + <file>platforms/+unix/+darwin/+ios/test</file> + </qresource> </RCC> diff --git a/tests/auto/corelib/io/qfileselector/tst_qfileselector.cpp b/tests/auto/corelib/io/qfileselector/tst_qfileselector.cpp index 11b1fdaeeb..bac7a69e0f 100644 --- a/tests/auto/corelib/io/qfileselector/tst_qfileselector.cpp +++ b/tests/auto/corelib/io/qfileselector/tst_qfileselector.cpp @@ -126,14 +126,6 @@ void tst_QFileSelector::basicTest_data() QTest::newRow("platform3") << QString(":/platforms/test3") << QStringList() << expectedPlatform3File; -#ifdef Q_OS_MACOS - // special case for compatibility code - QTest::newRow("osx-compat") << QString(":/platforms/test4") << QStringList() - << ":/platforms/+osx/test4"; - QTest::newRow("mac-compat") << QString(":/platforms/test5") << QStringList() - << ":/platforms/+mac/test5"; -#endif - QString resourceTestPath(":/extras/test"); QString custom1("custom1"); QTest::newRow("custom1-noselector") << resourceTestPath << QStringList() diff --git a/tests/auto/corelib/io/qfilesystementry/CMakeLists.txt b/tests/auto/corelib/io/qfilesystementry/CMakeLists.txt new file mode 100644 index 0000000000..e989315bdd --- /dev/null +++ b/tests/auto/corelib/io/qfilesystementry/CMakeLists.txt @@ -0,0 +1,13 @@ +# Generated from qfilesystementry.pro. + +##################################################################### +## tst_qfilesystementry Test: +##################################################################### + +add_qt_test(tst_qfilesystementry + SOURCES + ${QT_SOURCE_TREE}/src/corelib/io/qfilesystementry.cpp ${QT_SOURCE_TREE}/src/corelib/io/qfilesystementry_p.h + tst_qfilesystementry.cpp + PUBLIC_LIBRARIES + Qt::CorePrivate +) diff --git a/tests/auto/corelib/io/qfilesystemmetadata/CMakeLists.txt b/tests/auto/corelib/io/qfilesystemmetadata/CMakeLists.txt new file mode 100644 index 0000000000..a237090a48 --- /dev/null +++ b/tests/auto/corelib/io/qfilesystemmetadata/CMakeLists.txt @@ -0,0 +1,12 @@ +# Generated from qfilesystemmetadata.pro. + +##################################################################### +## tst_qfilesystemmetadata Test: +##################################################################### + +add_qt_test(tst_qfilesystemmetadata + SOURCES + tst_qfilesystemmetadata.cpp + PUBLIC_LIBRARIES + Qt::CorePrivate +) diff --git a/tests/auto/corelib/io/qfilesystemwatcher/CMakeLists.txt b/tests/auto/corelib/io/qfilesystemwatcher/CMakeLists.txt new file mode 100644 index 0000000000..1dfef5acab --- /dev/null +++ b/tests/auto/corelib/io/qfilesystemwatcher/CMakeLists.txt @@ -0,0 +1,10 @@ +# Generated from qfilesystemwatcher.pro. + +##################################################################### +## tst_qfilesystemwatcher Test: +##################################################################### + +add_qt_test(tst_qfilesystemwatcher + SOURCES + tst_qfilesystemwatcher.cpp +) diff --git a/tests/auto/corelib/io/qiodevice/CMakeLists.txt b/tests/auto/corelib/io/qiodevice/CMakeLists.txt new file mode 100644 index 0000000000..6b7833ac22 --- /dev/null +++ b/tests/auto/corelib/io/qiodevice/CMakeLists.txt @@ -0,0 +1,36 @@ +# Generated from qiodevice.pro. + +##################################################################### +## tst_qiodevice Test: +##################################################################### + +# Collect test data +list(APPEND test_data "tst_qiodevice.cpp") + +add_qt_test(tst_qiodevice + SOURCES + tst_qiodevice.cpp + PUBLIC_LIBRARIES + Qt::Network + TESTDATA ${test_data} +) + +#### Keys ignored in scope 1:.:.:qiodevice.pro:<TRUE>: +# MOC_DIR = "tmp" + +## Scopes: +##################################################################### + +if(ANDROID AND NOT ANDROID_EMBEDDED) + # Resources: + set(android_testdata_resource_files + "tst_qiodevice.cpp" + ) + + add_qt_resource(tst_qiodevice "android_testdata" + PREFIX + "/" + FILES + ${android_testdata_resource_files} + ) +endif() diff --git a/tests/auto/corelib/io/qipaddress/CMakeLists.txt b/tests/auto/corelib/io/qipaddress/CMakeLists.txt new file mode 100644 index 0000000000..821cd58bdb --- /dev/null +++ b/tests/auto/corelib/io/qipaddress/CMakeLists.txt @@ -0,0 +1,12 @@ +# Generated from qipaddress.pro. + +##################################################################### +## tst_qipaddress Test: +##################################################################### + +add_qt_test(tst_qipaddress + SOURCES + tst_qipaddress.cpp + PUBLIC_LIBRARIES + Qt::CorePrivate +) diff --git a/tests/auto/corelib/io/qlockfile/CMakeLists.txt b/tests/auto/corelib/io/qlockfile/CMakeLists.txt new file mode 100644 index 0000000000..52bd7bfd8f --- /dev/null +++ b/tests/auto/corelib/io/qlockfile/CMakeLists.txt @@ -0,0 +1,23 @@ +# Generated from qlockfile.pro. + +##################################################################### +## tst_qlockfile Test: +##################################################################### + +add_qt_test(tst_qlockfile + SOURCES + tst_qlockfile.cpp + LIBRARIES + Qt::CorePrivate + PUBLIC_LIBRARIES + Qt::Concurrent +) + +## Scopes: +##################################################################### + +extend_target(tst_qlockfile CONDITION WIN32 AND NOT WINRT + PUBLIC_LIBRARIES + advapi32 +) +add_subdirectory(qlockfiletesthelper) diff --git a/tests/auto/corelib/io/qlockfile/qlockfiletesthelper/.prev_CMakeLists.txt b/tests/auto/corelib/io/qlockfile/qlockfiletesthelper/.prev_CMakeLists.txt new file mode 100644 index 0000000000..755dc7cf39 --- /dev/null +++ b/tests/auto/corelib/io/qlockfile/qlockfiletesthelper/.prev_CMakeLists.txt @@ -0,0 +1,11 @@ +# Generated from qlockfile_test_helper.pro. + +##################################################################### +## qlockfile_test_helper Binary: +##################################################################### + +add_qt_executable(qlockfile_test_helper + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" + SOURCES + qlockfile_test_helper.cpp +) diff --git a/tests/auto/corelib/io/qlockfile/qlockfiletesthelper/CMakeLists.txt b/tests/auto/corelib/io/qlockfile/qlockfiletesthelper/CMakeLists.txt new file mode 100644 index 0000000000..b515037d56 --- /dev/null +++ b/tests/auto/corelib/io/qlockfile/qlockfiletesthelper/CMakeLists.txt @@ -0,0 +1,12 @@ +# Generated from qlockfile_test_helper.pro. + +##################################################################### +## qlockfile_test_helper Binary: +##################################################################### + +add_qt_test_helper(qlockfile_test_helper # special case + OVERRIDE_OUTPUT_DIRECTORY # special case + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" + SOURCES + qlockfile_test_helper.cpp +) diff --git a/tests/auto/corelib/io/qloggingcategory/CMakeLists.txt b/tests/auto/corelib/io/qloggingcategory/CMakeLists.txt new file mode 100644 index 0000000000..9e1eaf3e4a --- /dev/null +++ b/tests/auto/corelib/io/qloggingcategory/CMakeLists.txt @@ -0,0 +1,15 @@ +# Generated from qloggingcategory.pro. + +##################################################################### +## tst_qloggingcategory Test: +##################################################################### + +add_qt_test(tst_qloggingcategory + SOURCES + tst_qloggingcategory.cpp + PUBLIC_LIBRARIES + Qt::CorePrivate +) + +#### Keys ignored in scope 1:.:.:qloggingcategory.pro:<TRUE>: +# TEMPLATE = "app" diff --git a/tests/auto/corelib/io/qloggingregistry/CMakeLists.txt b/tests/auto/corelib/io/qloggingregistry/CMakeLists.txt new file mode 100644 index 0000000000..3c42af9d01 --- /dev/null +++ b/tests/auto/corelib/io/qloggingregistry/CMakeLists.txt @@ -0,0 +1,36 @@ +# Generated from qloggingregistry.pro. + +##################################################################### +## tst_qloggingregistry Test: +##################################################################### + +# Collect test data +list(APPEND test_data "qtlogging.ini") + +add_qt_test(tst_qloggingregistry + SOURCES + tst_qloggingregistry.cpp + PUBLIC_LIBRARIES + Qt::CorePrivate + TESTDATA ${test_data} +) + +#### Keys ignored in scope 1:.:.:qloggingregistry.pro:<TRUE>: +# TEMPLATE = "app" + +## Scopes: +##################################################################### + +if(ANDROID AND NOT ANDROID_EMBEDDED) + # Resources: + set(android_testdata_resource_files + "qtlogging.ini" + ) + + add_qt_resource(tst_qloggingregistry "android_testdata" + PREFIX + "/" + FILES + ${android_testdata_resource_files} + ) +endif() diff --git a/tests/auto/corelib/io/qnodebug/CMakeLists.txt b/tests/auto/corelib/io/qnodebug/CMakeLists.txt new file mode 100644 index 0000000000..4d1b57e222 --- /dev/null +++ b/tests/auto/corelib/io/qnodebug/CMakeLists.txt @@ -0,0 +1,10 @@ +# Generated from qnodebug.pro. + +##################################################################### +## tst_qnodebug Test: +##################################################################### + +add_qt_test(tst_qnodebug + SOURCES + tst_qnodebug.cpp +) diff --git a/tests/auto/corelib/io/qprocess-noapplication/CMakeLists.txt b/tests/auto/corelib/io/qprocess-noapplication/CMakeLists.txt new file mode 100644 index 0000000000..ce6195fc37 --- /dev/null +++ b/tests/auto/corelib/io/qprocess-noapplication/CMakeLists.txt @@ -0,0 +1,10 @@ +# Generated from qprocess-noapplication.pro. + +##################################################################### +## qprocess-noapplication Test: +##################################################################### + +add_qt_test(qprocess-noapplication + SOURCES + tst_qprocessnoapplication.cpp +) diff --git a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp index e799369c8a..269a59ae41 100644 --- a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp +++ b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp @@ -42,8 +42,6 @@ #include <QtNetwork/QHostInfo> #include <stdlib.h> -typedef void (QProcess::*QProcessFinishedSignal1)(int); -typedef void (QProcess::*QProcessFinishedSignal2)(int, QProcess::ExitStatus); typedef void (QProcess::*QProcessErrorSignal)(QProcess::ProcessError); class tst_QProcess : public QObject @@ -152,7 +150,6 @@ private slots: void failToStartEmptyArgs(); #if QT_DEPRECATED_SINCE(5, 13) - void crashTest2_deprecated(); void restartProcessDeadlock_deprecated(); void waitForReadyReadInAReadyReadSlot_deprecated(); void finishProcessBeforeReadingDone_deprecated(); @@ -350,7 +347,7 @@ void tst_QProcess::crashTest() qRegisterMetaType<QProcess::ExitStatus>("QProcess::ExitStatus"); QSignalSpy spy(process.data(), &QProcess::errorOccurred); - QSignalSpy spy2(process.data(), static_cast<QProcessFinishedSignal2>(&QProcess::finished)); + QSignalSpy spy2(process.data(), &QProcess::finished); QVERIFY(spy.isValid()); QVERIFY(spy2.isValid()); @@ -393,13 +390,12 @@ void tst_QProcess::crashTest2() qRegisterMetaType<QProcess::ExitStatus>("QProcess::ExitStatus"); QSignalSpy spy(&process, static_cast<QProcessErrorSignal>(&QProcess::errorOccurred)); - QSignalSpy spy2(&process, static_cast<QProcessFinishedSignal2>(&QProcess::finished)); + QSignalSpy spy2(&process, &QProcess::finished); QVERIFY(spy.isValid()); QVERIFY(spy2.isValid()); - QObject::connect(&process, static_cast<QProcessFinishedSignal2>(&QProcess::finished), - this, &tst_QProcess::exitLoopSlot); + QObject::connect(&process, &QProcess::finished, this, &tst_QProcess::exitLoopSlot); QTestEventLoop::instance().enterLoop(30); if (QTestEventLoop::instance().timeout()) @@ -724,15 +720,14 @@ void tst_QProcess::restartProcessDeadlock() // process in the finished() connected slot causes a deadlock // because of the way QProcessManager uses its locks. QProcess process; - connect(&process, static_cast<QProcessFinishedSignal2>(&QProcess::finished), - this, &tst_QProcess::restartProcess); + connect(&process, &QProcess::finished, this, &tst_QProcess::restartProcess); process.start("testProcessEcho/testProcessEcho"); QCOMPARE(process.write("", 1), qlonglong(1)); QVERIFY(process.waitForFinished(5000)); - QObject::disconnect(&process, static_cast<QProcessFinishedSignal2>(&QProcess::finished), nullptr, nullptr); + QObject::disconnect(&process, &QProcess::finished, nullptr, nullptr); QCOMPARE(process.write("", 1), qlonglong(1)); QVERIFY(process.waitForFinished(5000)); @@ -931,8 +926,7 @@ public: SoftExitProcess(int n) : waitedForFinished(false), n(n), killing(false) { - connect(this, static_cast<QProcessFinishedSignal2>(&QProcess::finished), - this, &SoftExitProcess::finishedSlot); + connect(this, &QProcess::finished, this, &SoftExitProcess::finishedSlot); switch (n) { case 0: @@ -1177,8 +1171,7 @@ protected: exitCode = 90210; QProcess process; - connect(&process, static_cast<QProcessFinishedSignal2>(&QProcess::finished), - this, &TestThread::catchExitCode, Qt::DirectConnection); + connect(&process, &QProcess::finished, this, &TestThread::catchExitCode, Qt::DirectConnection); process.start("testProcessEcho/testProcessEcho"); @@ -1251,8 +1244,7 @@ void tst_QProcess::waitForReadyReadInAReadyReadSlot() { QProcess process; connect(&process, &QIODevice::readyRead, this, &tst_QProcess::waitForReadyReadInAReadyReadSlotSlot); - connect(&process, static_cast<QProcessFinishedSignal2>(&QProcess::finished), - this, &tst_QProcess::exitLoopSlot); + connect(&process, &QProcess::finished, this, &tst_QProcess::exitLoopSlot); bytesAvailable = 0; process.start("testProcessEcho/testProcessEcho"); @@ -1490,7 +1482,7 @@ void tst_QProcess::failToStart() QProcess process; QSignalSpy stateSpy(&process, &QProcess::stateChanged); QSignalSpy errorSpy(&process, &QProcess::errorOccurred); - QSignalSpy finishedSpy(&process, static_cast<QProcessFinishedSignal2>(&QProcess::finished)); + QSignalSpy finishedSpy(&process, &QProcess::finished); QVERIFY(stateSpy.isValid()); QVERIFY(errorSpy.isValid()); QVERIFY(finishedSpy.isValid()); @@ -1499,10 +1491,6 @@ void tst_QProcess::failToStart() QSignalSpy errorSpy2(&process, static_cast<QProcessErrorSignal>(&QProcess::error)); QVERIFY(errorSpy2.isValid()); #endif -#if QT_DEPRECATED_SINCE(5, 13) - QSignalSpy finishedSpy2(&process, static_cast<QProcessFinishedSignal1>(&QProcess::finished)); - QVERIFY(finishedSpy2.isValid()); -#endif // OS X and HP-UX have a really low default process limit (~100), so spawning // to many processes here will cause test failures later on. @@ -1548,9 +1536,6 @@ void tst_QProcess::failToStart() #if QT_DEPRECATED_SINCE(5, 6) QCOMPARE(errorSpy2.count(), j * attempts + i + 1); #endif -#if QT_DEPRECATED_SINCE(5, 13) - QCOMPARE(finishedSpy2.count(), 0); -#endif int it = j * attempts + i + 1; @@ -1569,7 +1554,7 @@ void tst_QProcess::failToStartWithWait() QProcess process; QEventLoop loop; QSignalSpy errorSpy(&process, &QProcess::errorOccurred); - QSignalSpy finishedSpy(&process, static_cast<QProcessFinishedSignal2>(&QProcess::finished)); + QSignalSpy finishedSpy(&process, &QProcess::finished); QVERIFY(errorSpy.isValid()); QVERIFY(finishedSpy.isValid()); @@ -1577,10 +1562,6 @@ void tst_QProcess::failToStartWithWait() QSignalSpy errorSpy2(&process, static_cast<QProcessErrorSignal>(&QProcess::error)); QVERIFY(errorSpy2.isValid()); #endif -#if QT_DEPRECATED_SINCE(5, 13) - QSignalSpy finishedSpy2(&process, static_cast<QProcessFinishedSignal1>(&QProcess::finished)); - QVERIFY(finishedSpy2.isValid()); -#endif for (int i = 0; i < 50; ++i) { process.start("/blurp", QStringList() << "-v" << "-debug"); @@ -1592,10 +1573,6 @@ void tst_QProcess::failToStartWithWait() #if QT_DEPRECATED_SINCE(5, 6) QCOMPARE(errorSpy2.count(), i + 1); #endif -#if QT_DEPRECATED_SINCE(5, 13) - QCOMPARE(finishedSpy2.count(), 0); -#endif - } } @@ -1607,7 +1584,7 @@ void tst_QProcess::failToStartWithEventLoop() QProcess process; QEventLoop loop; QSignalSpy errorSpy(&process, &QProcess::errorOccurred); - QSignalSpy finishedSpy(&process, static_cast<QProcessFinishedSignal2>(&QProcess::finished)); + QSignalSpy finishedSpy(&process, &QProcess::finished); QVERIFY(errorSpy.isValid()); QVERIFY(finishedSpy.isValid()); @@ -1615,10 +1592,6 @@ void tst_QProcess::failToStartWithEventLoop() QSignalSpy errorSpy2(&process, static_cast<QProcessErrorSignal>(&QProcess::error)); QVERIFY(errorSpy2.isValid()); #endif -#if QT_DEPRECATED_SINCE(5, 13) - QSignalSpy finishedSpy2(&process, static_cast<QProcessFinishedSignal1>(&QProcess::finished)); - QVERIFY(finishedSpy2.isValid()); -#endif // The error signal may be emitted before start() returns connect(&process, &QProcess::errorOccurred, &loop, &QEventLoop::quit, Qt::QueuedConnection); @@ -1635,9 +1608,6 @@ void tst_QProcess::failToStartWithEventLoop() #if QT_DEPRECATED_SINCE(5, 6) QCOMPARE(errorSpy2.count(), i + 1); #endif -#if QT_DEPRECATED_SINCE(5, 13) - QCOMPARE(finishedSpy2.count(), 0); -#endif } } @@ -1912,7 +1882,7 @@ void tst_QProcess::waitForReadyReadForNonexistantProcess() QProcess process; QSignalSpy errorSpy(&process, &QProcess::errorOccurred); - QSignalSpy finishedSpy(&process, static_cast<QProcessFinishedSignal2>(&QProcess::finished)); + QSignalSpy finishedSpy(&process, &QProcess::finished); QVERIFY(errorSpy.isValid()); QVERIFY(finishedSpy.isValid()); @@ -1920,10 +1890,6 @@ void tst_QProcess::waitForReadyReadForNonexistantProcess() QSignalSpy errorSpy2(&process, static_cast<QProcessErrorSignal>(&QProcess::error)); QVERIFY(errorSpy2.isValid()); #endif -#if QT_DEPRECATED_SINCE(5, 13) - QSignalSpy finishedSpy1(&process, static_cast<QProcessFinishedSignal1>(&QProcess::finished)); - QVERIFY(finishedSpy1.isValid()); -#endif QVERIFY(!process.waitForReadyRead()); // used to crash process.start("doesntexist"); @@ -1935,9 +1901,6 @@ void tst_QProcess::waitForReadyReadForNonexistantProcess() QCOMPARE(errorSpy2.count(), 1); QCOMPARE(errorSpy2.at(0).at(0).toInt(), 0); #endif -#if QT_DEPRECATED_SINCE(5, 13) - QCOMPARE(finishedSpy1.count(), 0); -#endif } void tst_QProcess::setStandardInputFile() @@ -2390,7 +2353,7 @@ void tst_QProcess::onlyOneStartedSignal() QProcess process; QSignalSpy spyStarted(&process, &QProcess::started); - QSignalSpy spyFinished(&process, static_cast<QProcessFinishedSignal2>(&QProcess::finished)); + QSignalSpy spyFinished(&process, &QProcess::finished); QVERIFY(spyStarted.isValid()); QVERIFY(spyFinished.isValid()); @@ -2433,8 +2396,7 @@ void tst_QProcess::finishProcessBeforeReadingDone() QProcess process; BlockOnReadStdOut blocker(&process); QEventLoop loop; - connect(&process, static_cast<QProcessFinishedSignal2>(&QProcess::finished), - &loop, &QEventLoop::quit); + connect(&process, &QProcess::finished, &loop, &QEventLoop::quit); process.start("testProcessOutput/testProcessOutput"); QVERIFY(process.waitForStarted()); loop.exec(); @@ -2581,52 +2543,20 @@ void tst_QProcess::processEventsInAReadyReadSlot() #if QT_DEPRECATED_SINCE(5, 13) -void tst_QProcess::crashTest2_deprecated() -{ - QProcess process; - process.start("testProcessCrash/testProcessCrash"); - QVERIFY(process.waitForStarted(5000)); - - qRegisterMetaType<QProcess::ProcessError>("QProcess::ProcessError"); - qRegisterMetaType<QProcess::ExitStatus>("QProcess::ExitStatus"); - - QSignalSpy spy(&process, static_cast<QProcessErrorSignal>(&QProcess::errorOccurred)); - QSignalSpy spy2(&process, static_cast<QProcessFinishedSignal2>(&QProcess::finished)); - - QVERIFY(spy.isValid()); - QVERIFY(spy2.isValid()); - - QObject::connect(&process, static_cast<QProcessFinishedSignal1>(&QProcess::finished), - this, &tst_QProcess::exitLoopSlot); - - QTestEventLoop::instance().enterLoop(30); - if (QTestEventLoop::instance().timeout()) - QFAIL("Failed to detect crash : operation timed out"); - - QCOMPARE(spy.count(), 1); - QCOMPARE(*static_cast<const QProcess::ProcessError *>(spy.at(0).at(0).constData()), QProcess::Crashed); - - QCOMPARE(spy2.count(), 1); - QCOMPARE(*static_cast<const QProcess::ExitStatus *>(spy2.at(0).at(1).constData()), QProcess::CrashExit); - - QCOMPARE(process.exitStatus(), QProcess::CrashExit); -} - void tst_QProcess::restartProcessDeadlock_deprecated() { // The purpose of this test is to detect whether restarting a // process in the finished() connected slot causes a deadlock // because of the way QProcessManager uses its locks. QProcess process; - connect(&process, static_cast<QProcessFinishedSignal1>(&QProcess::finished), - this, &tst_QProcess::restartProcess); + connect(&process, &QProcess::finished, this, &tst_QProcess::restartProcess); process.start("testProcessEcho/testProcessEcho"); QCOMPARE(process.write("", 1), qlonglong(1)); QVERIFY(process.waitForFinished(5000)); - QObject::disconnect(&process, static_cast<QProcessFinishedSignal1>(&QProcess::finished), nullptr, nullptr); + QObject::disconnect(&process, &QProcess::finished, nullptr, nullptr); QCOMPARE(process.write("", 1), qlonglong(1)); QVERIFY(process.waitForFinished(5000)); @@ -2638,8 +2568,7 @@ void tst_QProcess::waitForReadyReadInAReadyReadSlot_deprecated() { QProcess process; connect(&process, &QIODevice::readyRead, this, &tst_QProcess::waitForReadyReadInAReadyReadSlotSlot); - connect(&process, static_cast<QProcessFinishedSignal1>(&QProcess::finished), - this, &tst_QProcess::exitLoopSlot); + connect(&process, &QProcess::finished, this, &tst_QProcess::exitLoopSlot); bytesAvailable = 0; process.start("testProcessEcho/testProcessEcho"); @@ -2665,8 +2594,7 @@ void tst_QProcess::finishProcessBeforeReadingDone_deprecated() QProcess process; BlockOnReadStdOut blocker(&process); QEventLoop loop; - connect(&process, static_cast<QProcessFinishedSignal1>(&QProcess::finished), - &loop, &QEventLoop::quit); + connect(&process, &QProcess::finished, &loop, &QEventLoop::quit); process.start("testProcessOutput/testProcessOutput"); QVERIFY(process.waitForStarted()); loop.exec(); diff --git a/tests/auto/corelib/io/qprocessenvironment/CMakeLists.txt b/tests/auto/corelib/io/qprocessenvironment/CMakeLists.txt new file mode 100644 index 0000000000..dbcd8c8172 --- /dev/null +++ b/tests/auto/corelib/io/qprocessenvironment/CMakeLists.txt @@ -0,0 +1,10 @@ +# Generated from qprocessenvironment.pro. + +##################################################################### +## tst_qprocessenvironment Test: +##################################################################### + +add_qt_test(tst_qprocessenvironment + SOURCES + tst_qprocessenvironment.cpp +) diff --git a/tests/auto/corelib/io/qsavefile/CMakeLists.txt b/tests/auto/corelib/io/qsavefile/CMakeLists.txt new file mode 100644 index 0000000000..aec5da1f99 --- /dev/null +++ b/tests/auto/corelib/io/qsavefile/CMakeLists.txt @@ -0,0 +1,14 @@ +# Generated from qsavefile.pro. + +##################################################################### +## tst_qsavefile Test: +##################################################################### + +# Collect test data +list(APPEND test_data "tst_qsavefile.cpp") + +add_qt_test(tst_qsavefile + SOURCES + tst_qsavefile.cpp + TESTDATA ${test_data} +) diff --git a/tests/auto/corelib/io/qsettings/CMakeLists.txt b/tests/auto/corelib/io/qsettings/CMakeLists.txt new file mode 100644 index 0000000000..161b03b041 --- /dev/null +++ b/tests/auto/corelib/io/qsettings/CMakeLists.txt @@ -0,0 +1,50 @@ +# Generated from qsettings.pro. + +##################################################################### +## tst_qsettings Test: +##################################################################### + +add_qt_test(tst_qsettings + SOURCES + tst_qsettings.cpp + DEFINES + QT_DISABLE_DEPRECATED_BEFORE=0 + INCLUDE_DIRECTORIES + ../../kernel/qmetatype + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui +) + +# Resources: +set(qsettings_resource_files + "bom.ini" + "resourcefile.ini" + "resourcefile2.ini" + "resourcefile3.ini" + "resourcefile4.ini" + "resourcefile5.ini" + "resourcefile6.plist" + "withcomments.ini" +) + +add_qt_resource(tst_qsettings "qsettings" + PREFIX + "/" + FILES + ${qsettings_resource_files} +) + + +## Scopes: +##################################################################### + +extend_target(tst_qsettings CONDITION MSVC + PUBLIC_LIBRARIES + advapi32 +) + +extend_target(tst_qsettings CONDITION APPLE + PUBLIC_LIBRARIES + ${FWCoreFoundation} +) diff --git a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp index 0f07ba4bb2..c969e72c18 100644 --- a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp +++ b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp @@ -39,7 +39,9 @@ #include <QtCore/QDir> #include <QtCore/QThread> #include <QtCore/QSysInfo> -#include <QtGui/QKeySequence> +#if QT_CONFIG(shortcut) +# include <QtGui/QKeySequence> +#endif #include <QtCore> #include <QtGui> @@ -1364,6 +1366,7 @@ void tst_QSettings::testVariantTypes() dt.setOffsetFromUtc(3600); testVal("key14", dt, QDateTime, DateTime); +#if QT_CONFIG(shortcut) // We store key sequences as strings instead of binary variant blob, for improved // readability in the resulting format. if (format >= QSettings::InvalidFormat) { @@ -1373,6 +1376,7 @@ void tst_QSettings::testVariantTypes() QKeySequence(Qt::ControlModifier + Qt::Key_F1).toString(QKeySequence::NativeText), QString, String); } +#endif // QT_CONFIG(shortcut) #undef testVal } diff --git a/tests/auto/corelib/io/qstandardpaths/CMakeLists.txt b/tests/auto/corelib/io/qstandardpaths/CMakeLists.txt new file mode 100644 index 0000000000..5bceaf1d77 --- /dev/null +++ b/tests/auto/corelib/io/qstandardpaths/CMakeLists.txt @@ -0,0 +1,26 @@ +# Generated from qstandardpaths.pro. + +##################################################################### +## tst_qstandardpaths Test: +##################################################################### + +# Collect test data +list(APPEND test_data "tst_qstandardpaths.cpp") +list(APPEND test_data "qstandardpaths.pro") + +add_qt_test(tst_qstandardpaths + SOURCES + ../../../../shared/emulationdetector.h + tst_qstandardpaths.cpp + INCLUDE_DIRECTORIES + ../../../../shared + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +extend_target(tst_qstandardpaths CONDITION boot2qt + DEFINES + SKIP_FINDEXECUTABLE +) diff --git a/tests/auto/corelib/io/qstorageinfo/CMakeLists.txt b/tests/auto/corelib/io/qstorageinfo/CMakeLists.txt new file mode 100644 index 0000000000..08af02dc6c --- /dev/null +++ b/tests/auto/corelib/io/qstorageinfo/CMakeLists.txt @@ -0,0 +1,12 @@ +# Generated from qstorageinfo.pro. + +##################################################################### +## tst_qstorageinfo Test: +##################################################################### + +add_qt_test(tst_qstorageinfo + SOURCES + tst_qstorageinfo.cpp + PUBLIC_LIBRARIES + Qt::CorePrivate +) diff --git a/tests/auto/corelib/io/qtemporarydir/CMakeLists.txt b/tests/auto/corelib/io/qtemporarydir/CMakeLists.txt new file mode 100644 index 0000000000..855495bbbb --- /dev/null +++ b/tests/auto/corelib/io/qtemporarydir/CMakeLists.txt @@ -0,0 +1,15 @@ +# Generated from qtemporarydir.pro. + +##################################################################### +## tst_qtemporarydir Test: +##################################################################### + +add_qt_test(tst_qtemporarydir + SOURCES + ../../../../shared/emulationdetector.h + tst_qtemporarydir.cpp + INCLUDE_DIRECTORIES + ../../../../shared + PUBLIC_LIBRARIES + Qt::TestPrivate +) diff --git a/tests/auto/corelib/io/qtemporaryfile/CMakeLists.txt b/tests/auto/corelib/io/qtemporaryfile/CMakeLists.txt new file mode 100644 index 0000000000..af614552cc --- /dev/null +++ b/tests/auto/corelib/io/qtemporaryfile/CMakeLists.txt @@ -0,0 +1,47 @@ +# Generated from qtemporaryfile.pro. + +##################################################################### +## tst_qtemporaryfile Test: +##################################################################### + +# Collect test data +list(APPEND test_data "tst_qtemporaryfile.cpp") + +add_qt_test(tst_qtemporaryfile + SOURCES + tst_qtemporaryfile.cpp + PUBLIC_LIBRARIES + Qt::TestPrivate + TESTDATA ${test_data} +) + +# Resources: +set(qtemporaryfile_resource_files + "resources/test.txt" +) + +add_qt_resource(tst_qtemporaryfile "qtemporaryfile" + PREFIX + "/" + FILES + ${qtemporaryfile_resource_files} +) + + +## Scopes: +##################################################################### + +if(ANDROID AND NOT ANDROID_EMBEDDED) + # Resources: + set(android_testdata_resource_files + "resources/test.txt" + "tst_qtemporaryfile.cpp" + ) + + add_qt_resource(tst_qtemporaryfile "android_testdata" + PREFIX + "/android_testdata" + FILES + ${android_testdata_resource_files} + ) +endif() diff --git a/tests/auto/corelib/io/qurl/CMakeLists.txt b/tests/auto/corelib/io/qurl/CMakeLists.txt new file mode 100644 index 0000000000..c23ad27cfc --- /dev/null +++ b/tests/auto/corelib/io/qurl/CMakeLists.txt @@ -0,0 +1,20 @@ +# Generated from qurl.pro. + +##################################################################### +## tst_qurl Test: +##################################################################### + +add_qt_test(tst_qurl + SOURCES + tst_qurl.cpp + PUBLIC_LIBRARIES + Qt::Concurrent +) + +## Scopes: +##################################################################### + +extend_target(tst_qurl CONDITION APPLE + SOURCES + tst_qurl_mac.mm +) diff --git a/tests/auto/corelib/io/qurl/tst_qurl.cpp b/tests/auto/corelib/io/qurl/tst_qurl.cpp index ef4325d2ea..8d046d5499 100644 --- a/tests/auto/corelib/io/qurl/tst_qurl.cpp +++ b/tests/auto/corelib/io/qurl/tst_qurl.cpp @@ -48,8 +48,6 @@ class tst_QUrl : public QObject private slots: void initTestCase(); void cleanupTestCase(); - void effectiveTLDs_data(); - void effectiveTLDs(); void getSetCheck(); void constructing(); void hashInPath(); @@ -3387,61 +3385,6 @@ void tst_QUrl::acceptEmptyAuthoritySegments() QCOMPARE(QUrl(file_uni_bar, QUrl::StrictMode).toString(), file_triple_bar); } -void tst_QUrl::effectiveTLDs_data() -{ - // See also: tst_QNetworkCookieJar::setCookiesFromUrl(). - // in tests/auto/network/access/qnetworkcookiejar/tst_qnetworkcookiejar.cpp - QTest::addColumn<QUrl>("domain"); - QTest::addColumn<QString>("TLD"); - // TODO: autogenerate test-cases from: - // https://raw.githubusercontent.com/publicsuffix/list/master/tests/test_psl.txt - // checkPublicSuffix(domain, tail) appears in the list if - // either tail is null and domain is public or - // tail is the "registrable" part of domain; i.e. its minimal non-public tail. - - QTest::newRow("yes0") << QUrl::fromEncoded("http://test.co.uk") << ".co.uk"; - QTest::newRow("yes1") << QUrl::fromEncoded("http://test.com") << ".com"; - QTest::newRow("yes2") << QUrl::fromEncoded("http://www.test.de") << ".de"; - QTest::newRow("yes3") << QUrl::fromEncoded("http://test.ulm.museum") << ".ulm.museum"; - QTest::newRow("yes4") << QUrl::fromEncoded("http://www.com.krodsherad.no") << ".krodsherad.no"; - QTest::newRow("yes5") << QUrl::fromEncoded("http://www.co.uk.1.bg") << ".1.bg"; - QTest::newRow("yes6") << QUrl::fromEncoded("http://www.com.com.cn") << ".com.cn"; - QTest::newRow("yes7") << QUrl::fromEncoded("http://www.test.org.ws") << ".org.ws"; - QTest::newRow("yes9") << QUrl::fromEncoded("http://www.com.co.uk.wallonie.museum") << ".wallonie.museum"; - QTest::newRow("yes10") << QUrl::fromEncoded("http://www.com.evje-og-hornnes.no") << ".evje-og-hornnes.no"; - QTest::newRow("yes11") << QUrl::fromEncoded("http://www.bla.kamijima.ehime.jp") << ".kamijima.ehime.jp"; - QTest::newRow("yes12") << QUrl::fromEncoded("http://www.bla.kakuda.miyagi.jp") << ".kakuda.miyagi.jp"; - QTest::newRow("yes13") << QUrl::fromEncoded("http://mypage.betainabox.com") << ".betainabox.com"; - QTest::newRow("yes14") << QUrl::fromEncoded("http://mypage.rhcloud.com") << ".rhcloud.com"; - QTest::newRow("yes15") << QUrl::fromEncoded("http://mypage.int.az") << ".int.az"; - QTest::newRow("yes16") << QUrl::fromEncoded("http://anything.pagespeedmobilizer.com") << ".pagespeedmobilizer.com"; - QTest::newRow("yes17") << QUrl::fromEncoded("http://anything.eu-central-1.compute.amazonaws.com") << ".eu-central-1.compute.amazonaws.com"; - QTest::newRow("yes18") << QUrl::fromEncoded("http://anything.ltd.hk") << ".ltd.hk"; - QTest::newRow("trentino.it") - << QUrl::fromEncoded("http://any.thing.trentino.it") << ".trentino.it"; - QTest::newRow("net.ni") << QUrl::fromEncoded("http://test.net.ni") << ".net.ni"; - QTest::newRow("dyn.cosidns.de") - << QUrl::fromEncoded("http://test.dyn.cosidns.de") << ".dyn.cosidns.de"; - QTest::newRow("freeddns.org") - << QUrl::fromEncoded("http://test.freeddns.org") << ".freeddns.org"; - QTest::newRow("app.os.stg.fedoraproject.org") - << QUrl::fromEncoded("http://test.app.os.stg.fedoraproject.org") - << ".app.os.stg.fedoraproject.org"; - QTest::newRow("development.run") << QUrl::fromEncoded("http://test.development.run") << ".development.run"; - QTest::newRow("crafting.xyz") << QUrl::fromEncoded("http://test.crafting.xyz") << ".crafting.xyz"; - QTest::newRow("nym.ie") << QUrl::fromEncoded("http://shamus.nym.ie") << ".nym.ie"; - QTest::newRow("vapor.cloud") << QUrl::fromEncoded("http://test.vapor.cloud") << ".vapor.cloud"; - QTest::newRow("official.academy") << QUrl::fromEncoded("http://acredited.official.academy") << ".official.academy"; -} - -void tst_QUrl::effectiveTLDs() -{ - QFETCH(QUrl, domain); - QFETCH(QString, TLD); - QCOMPARE(domain.topLevelDomain(QUrl::PrettyDecoded), TLD); - QCOMPARE(domain.topLevelDomain(QUrl::FullyDecoded), TLD); -} - void tst_QUrl::lowercasesScheme() { QUrl url; diff --git a/tests/auto/corelib/io/qurlinternal/CMakeLists.txt b/tests/auto/corelib/io/qurlinternal/CMakeLists.txt new file mode 100644 index 0000000000..5ad3bc1919 --- /dev/null +++ b/tests/auto/corelib/io/qurlinternal/CMakeLists.txt @@ -0,0 +1,20 @@ +# Generated from qurlinternal.pro. + +if(NOT QT_FEATURE_private_tests) + return() +endif() + +##################################################################### +## tst_qurlinternal Test: +##################################################################### + +add_qt_test(tst_qurlinternal + SOURCES + ../../codecs/utf8/utf8data.cpp + tst_qurlinternal.cpp + PUBLIC_LIBRARIES + Qt::CorePrivate +) + +#### Keys ignored in scope 1:.:.:qurlinternal.pro:<TRUE>: +# _REQUIREMENTS = "qtConfig(private_tests)" diff --git a/tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp b/tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp index 5c6e633749..f644979c06 100644 --- a/tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp +++ b/tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp @@ -30,7 +30,6 @@ #include <QtCore/QUrl> #include <QtTest/QtTest> -#include "private/qtldurl_p.h" #include "private/qurl_p.h" // For testsuites diff --git a/tests/auto/corelib/io/qurlquery/CMakeLists.txt b/tests/auto/corelib/io/qurlquery/CMakeLists.txt new file mode 100644 index 0000000000..8a0cc54aeb --- /dev/null +++ b/tests/auto/corelib/io/qurlquery/CMakeLists.txt @@ -0,0 +1,14 @@ +# Generated from qurlquery.pro. + +##################################################################### +## tst_qurlquery Test: +##################################################################### + +add_qt_test(tst_qurlquery + SOURCES + tst_qurlquery.cpp + DEFINES + SRCDIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/\\\" + PUBLIC_LIBRARIES + Qt::CorePrivate +) |