summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorIevgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>2021-08-10 13:10:04 +0200
committerIevgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>2021-08-17 14:39:43 +0200
commit9a119d8c7f8520e318297edbad116eb291eb1c07 (patch)
tree4de9b507b5a6e4e852d91404380fa6a12af83fc3 /tests
parent49c4ad245df0e4e3824578a7956770c7aeb50fea (diff)
tests: Use QT_TESTCASE_SOURCEDIR define
Replace custom SRCDIR define with QT_TESTCASE_SOURCEDIR. The latter is automatically available to all tests to use and serves the same purpose but is not terminated by a slash. Change-Id: I62896d0fd84ac63ac1b74a459ec1646c6bde0a46 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit c859b335b93988584422eb8eb0c78db803369985) Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/gui/text/qcssparser/CMakeLists.txt2
-rw-r--r--tests/auto/gui/text/qcssparser/tst_qcssparser.cpp2
-rw-r--r--tests/auto/network/access/http2/CMakeLists.txt2
-rw-r--r--tests/auto/network/access/http2/http2srv.cpp4
-rw-r--r--tests/auto/widgets/dialogs/qfiledialog/CMakeLists.txt2
-rw-r--r--tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp2
6 files changed, 4 insertions, 10 deletions
diff --git a/tests/auto/gui/text/qcssparser/CMakeLists.txt b/tests/auto/gui/text/qcssparser/CMakeLists.txt
index adb3e6269c..058a42d68c 100644
--- a/tests/auto/gui/text/qcssparser/CMakeLists.txt
+++ b/tests/auto/gui/text/qcssparser/CMakeLists.txt
@@ -14,8 +14,6 @@ list(APPEND test_data "testdata")
qt_internal_add_test(tst_qcssparser
SOURCES
tst_qcssparser.cpp
- DEFINES
- SRCDIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}\\\"
PUBLIC_LIBRARIES
Qt::Gui
Qt::GuiPrivate
diff --git a/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp b/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp
index 0af87353b6..f51c0eab20 100644
--- a/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp
+++ b/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp
@@ -90,7 +90,7 @@ void tst_QCssParser::scanner_data()
#if defined(Q_OS_ANDROID)
QDir d(":/");
#else
- QDir d(SRCDIR);
+ QDir d(QT_TESTCASE_SOURCEDIR);
#endif
d.cd("testdata");
d.cd("scanner");
diff --git a/tests/auto/network/access/http2/CMakeLists.txt b/tests/auto/network/access/http2/CMakeLists.txt
index 735f95deff..5adee76cbb 100644
--- a/tests/auto/network/access/http2/CMakeLists.txt
+++ b/tests/auto/network/access/http2/CMakeLists.txt
@@ -8,8 +8,6 @@ qt_internal_add_test(tst_http2
SOURCES
http2srv.cpp http2srv.h
tst_http2.cpp
- DEFINES
- SRCDIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/\\\"
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Network
diff --git a/tests/auto/network/access/http2/http2srv.cpp b/tests/auto/network/access/http2/http2srv.cpp
index 932b11fbb6..bfd1ad4b80 100644
--- a/tests/auto/network/access/http2/http2srv.cpp
+++ b/tests/auto/network/access/http2/http2srv.cpp
@@ -318,11 +318,11 @@ void Http2Server::incomingConnection(qintptr socketDescriptor)
sslSocket->setProtocol(QSsl::TlsV1_2OrLater);
connect(sslSocket, SIGNAL(sslErrors(QList<QSslError>)),
this, SLOT(ignoreErrorSlot()));
- QFile file(SRCDIR "certs/fluke.key");
+ QFile file(QT_TESTCASE_SOURCEDIR "/certs/fluke.key");
file.open(QIODevice::ReadOnly);
QSslKey key(file.readAll(), QSsl::Rsa, QSsl::Pem, QSsl::PrivateKey);
sslSocket->setPrivateKey(key);
- auto localCert = QSslCertificate::fromPath(SRCDIR "certs/fluke.cert");
+ auto localCert = QSslCertificate::fromPath(QT_TESTCASE_SOURCEDIR "/certs/fluke.cert");
sslSocket->setLocalCertificateChain(localCert);
sslSocket->setSocketDescriptor(socketDescriptor, QAbstractSocket::ConnectedState);
// Stop listening.
diff --git a/tests/auto/widgets/dialogs/qfiledialog/CMakeLists.txt b/tests/auto/widgets/dialogs/qfiledialog/CMakeLists.txt
index 6515645c05..043dd2b2a9 100644
--- a/tests/auto/widgets/dialogs/qfiledialog/CMakeLists.txt
+++ b/tests/auto/widgets/dialogs/qfiledialog/CMakeLists.txt
@@ -7,8 +7,6 @@
qt_internal_add_test(tst_qfiledialog
SOURCES
tst_qfiledialog.cpp
- DEFINES
- SRCDIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/\\\"
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
diff --git a/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp b/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp
index 2fe9f9b00d..e485fd6990 100644
--- a/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp
+++ b/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp
@@ -303,7 +303,7 @@ void tst_QFiledialog::filesSelectedSignal()
{
QFileDialog fd;
fd.setViewMode(QFileDialog::List);
- QDir testDir(SRCDIR);
+ QDir testDir(QT_TESTCASE_SOURCEDIR);
fd.setDirectory(testDir);
QFETCH(QFileDialog::FileMode, fileMode);
fd.setFileMode(fileMode);