diff options
Diffstat (limited to 'tests/auto/tools')
-rw-r--r-- | tests/auto/tools/moc/moc.pro | 10 | ||||
-rw-r--r-- | tests/auto/tools/moc/no-keywords.h | 15 | ||||
-rw-r--r-- | tests/auto/tools/qmakelib/evaltest.cpp | 16 |
3 files changed, 28 insertions, 13 deletions
diff --git a/tests/auto/tools/moc/moc.pro b/tests/auto/tools/moc/moc.pro index d2b13f9c4e..3cbc9ebb5e 100644 --- a/tests/auto/tools/moc/moc.pro +++ b/tests/auto/tools/moc/moc.pro @@ -36,11 +36,11 @@ if(*-g++*|*-icc*|*-clang*|*-llvm):!win32-*: HEADERS += os9-newlines.h win-newlin if(*-g++*|*-clang*): HEADERS += dollars.h SOURCES += tst_moc.cpp -QT = core sql network testlib -qtHaveModule(dbus) { - DEFINES += WITH_DBUS - QT += dbus -} +QT = core testlib +qtHaveModule(dbus): QT += dbus +qtHaveModule(concurrent): QT += concurrent +qtHaveModule(network): QT += network +qtHaveModule(sql): QT += sql # tst_Moc::specifyMetaTagsFromCmdline() # Ensure that plugin_metadata.h are moc-ed with some extra -M arguments: diff --git a/tests/auto/tools/moc/no-keywords.h b/tests/auto/tools/moc/no-keywords.h index d31063665b..ca77056503 100644 --- a/tests/auto/tools/moc/no-keywords.h +++ b/tests/auto/tools/moc/no-keywords.h @@ -37,16 +37,19 @@ #define slots Baz #define emit Yoyodyne +#include <QtCore/QtCore> + +#ifdef QT_CONCURRENT_LIB #include <QtConcurrent/QtConcurrent> -#include <QtCore> +#endif +#ifdef QT_NETWORK_LIB #include <QtNetwork/QtNetwork> +#endif +#ifdef QT_SQL_LIB #include <QtSql/QtSql> -//#include <QtSvg> -#if defined(WITH_DBUS) -#include <QtDBus> #endif -#ifdef QT_SCRIPT_LIB -#include <QtScript> +#ifdef QT_DBUS_LIB +#include <QtDBus/QtDBus> #endif #undef signals diff --git a/tests/auto/tools/qmakelib/evaltest.cpp b/tests/auto/tools/qmakelib/evaltest.cpp index 786b9e72f1..abb7a1a964 100644 --- a/tests/auto/tools/qmakelib/evaltest.cpp +++ b/tests/auto/tools/qmakelib/evaltest.cpp @@ -1604,6 +1604,12 @@ void tst_qmakelib::addReplaceFunctions(const QString &qindir) << "" << true; + QTest::newRow("$$absolute_path(): relative file & relative path") + << "VAR = $$absolute_path(dir/file.ext, some/where)" + << "VAR = " + qindir + "/some/where/dir/file.ext" + << "" + << true; + QTest::newRow("$$absolute_path(): file & path") << "VAR = $$absolute_path(dir/file.ext, " EVAL_DRIVE "/root/sub)" << "VAR = " EVAL_DRIVE "/root/sub/dir/file.ext" @@ -1642,6 +1648,12 @@ void tst_qmakelib::addReplaceFunctions(const QString &qindir) << "" << true; + QTest::newRow("$$relative_path(): relative file & relative path") + << "VAR = $$relative_path(dir/file.ext, some/where)" + << "VAR = dir/file.ext" + << "" + << true; + QTest::newRow("$$relative_path(): relative file to empty") << "VAR = $$relative_path(dir/..)" << "VAR = ." @@ -2752,9 +2764,9 @@ void tst_qmakelib::proEval_data() // Raw data leak with empty file name. Verify with Valgrind or asan. QTest::newRow("QTBUG-54550") - << "FULL = /there/is\n" + << "FULL = " EVAL_DRIVE "/there/is\n" "VAR = $$absolute_path(, $$FULL/nothing/here/really)" - << "VAR = /there/is/nothing/here/really" + << "VAR = " EVAL_DRIVE "/there/is/nothing/here/really" << "" << true; } |