summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/global
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/corelib/global')
-rw-r--r--tests/auto/corelib/global/CMakeLists.txt12
-rw-r--r--tests/auto/corelib/global/q_func_info/CMakeLists.txt10
-rw-r--r--tests/auto/corelib/global/qflags/CMakeLists.txt13
-rw-r--r--tests/auto/corelib/global/qfloat16/CMakeLists.txt10
-rw-r--r--tests/auto/corelib/global/qgetputenv/CMakeLists.txt10
-rw-r--r--tests/auto/corelib/global/qglobal/CMakeLists.txt14
-rw-r--r--tests/auto/corelib/global/qglobalstatic/CMakeLists.txt15
-rw-r--r--tests/auto/corelib/global/qhooks/CMakeLists.txt12
-rw-r--r--tests/auto/corelib/global/qlogging/CMakeLists.txt25
-rw-r--r--tests/auto/corelib/global/qlogging/test/test.pro1
-rw-r--r--tests/auto/corelib/global/qlogging/tst_qlogging.cpp15
-rw-r--r--tests/auto/corelib/global/qnumeric/CMakeLists.txt26
-rw-r--r--tests/auto/corelib/global/qrand/CMakeLists.txt10
-rw-r--r--tests/auto/corelib/global/qrandomgenerator/CMakeLists.txt12
-rw-r--r--tests/auto/corelib/global/qtendian/CMakeLists.txt12
15 files changed, 193 insertions, 4 deletions
diff --git a/tests/auto/corelib/global/CMakeLists.txt b/tests/auto/corelib/global/CMakeLists.txt
new file mode 100644
index 0000000000..58e083d665
--- /dev/null
+++ b/tests/auto/corelib/global/CMakeLists.txt
@@ -0,0 +1,12 @@
+add_subdirectory(q_func_info)
+add_subdirectory(qflags)
+add_subdirectory(qfloat16)
+add_subdirectory(qgetputenv)
+add_subdirectory(qglobalstatic)
+add_subdirectory(qhooks)
+add_subdirectory(qlogging)
+add_subdirectory(qnumeric)
+add_subdirectory(qrand)
+add_subdirectory(qrandomgenerator)
+add_subdirectory(qtendian)
+
diff --git a/tests/auto/corelib/global/q_func_info/CMakeLists.txt b/tests/auto/corelib/global/q_func_info/CMakeLists.txt
new file mode 100644
index 0000000000..5435c97cf8
--- /dev/null
+++ b/tests/auto/corelib/global/q_func_info/CMakeLists.txt
@@ -0,0 +1,10 @@
+# Generated from q_func_info.pro.
+
+#####################################################################
+## tst_q_func_info Test:
+#####################################################################
+
+add_qt_test(tst_q_func_info
+ SOURCES
+ tst_q_func_info.cpp
+)
diff --git a/tests/auto/corelib/global/qflags/CMakeLists.txt b/tests/auto/corelib/global/qflags/CMakeLists.txt
new file mode 100644
index 0000000000..f1fdb7a5f8
--- /dev/null
+++ b/tests/auto/corelib/global/qflags/CMakeLists.txt
@@ -0,0 +1,13 @@
+# Generated from qflags.pro.
+
+#####################################################################
+## tst_qflags Test:
+#####################################################################
+
+add_qt_test(tst_qflags
+ SOURCES
+ tst_qflags.cpp
+)
+
+## Scopes:
+#####################################################################
diff --git a/tests/auto/corelib/global/qfloat16/CMakeLists.txt b/tests/auto/corelib/global/qfloat16/CMakeLists.txt
new file mode 100644
index 0000000000..36e15d8225
--- /dev/null
+++ b/tests/auto/corelib/global/qfloat16/CMakeLists.txt
@@ -0,0 +1,10 @@
+# Generated from qfloat16.pro.
+
+#####################################################################
+## tst_qfloat16 Test:
+#####################################################################
+
+add_qt_test(tst_qfloat16
+ SOURCES
+ tst_qfloat16.cpp
+)
diff --git a/tests/auto/corelib/global/qgetputenv/CMakeLists.txt b/tests/auto/corelib/global/qgetputenv/CMakeLists.txt
new file mode 100644
index 0000000000..c5f3a53810
--- /dev/null
+++ b/tests/auto/corelib/global/qgetputenv/CMakeLists.txt
@@ -0,0 +1,10 @@
+# Generated from qgetputenv.pro.
+
+#####################################################################
+## tst_qgetputenv Test:
+#####################################################################
+
+add_qt_test(tst_qgetputenv
+ SOURCES
+ tst_qgetputenv.cpp
+)
diff --git a/tests/auto/corelib/global/qglobal/CMakeLists.txt b/tests/auto/corelib/global/qglobal/CMakeLists.txt
new file mode 100644
index 0000000000..1efaaa71d0
--- /dev/null
+++ b/tests/auto/corelib/global/qglobal/CMakeLists.txt
@@ -0,0 +1,14 @@
+# Generated from qglobal.pro.
+
+#####################################################################
+## tst_qglobal Test:
+#####################################################################
+
+add_qt_test(tst_qglobal
+ SOURCES
+ qglobal.c
+ tst_qglobal.cpp
+)
+
+## Scopes:
+#####################################################################
diff --git a/tests/auto/corelib/global/qglobalstatic/CMakeLists.txt b/tests/auto/corelib/global/qglobalstatic/CMakeLists.txt
new file mode 100644
index 0000000000..1486256a94
--- /dev/null
+++ b/tests/auto/corelib/global/qglobalstatic/CMakeLists.txt
@@ -0,0 +1,15 @@
+# Generated from qglobalstatic.pro.
+
+#####################################################################
+## tst_qglobalstatic Test:
+#####################################################################
+
+add_qt_test(tst_qglobalstatic
+ EXCEPTIONS
+ SOURCES
+ tst_qglobalstatic.cpp
+ DEFINES
+ SRCDIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/\\\"
+ LIBRARIES
+ Qt::CorePrivate
+)
diff --git a/tests/auto/corelib/global/qhooks/CMakeLists.txt b/tests/auto/corelib/global/qhooks/CMakeLists.txt
new file mode 100644
index 0000000000..01b3196bd1
--- /dev/null
+++ b/tests/auto/corelib/global/qhooks/CMakeLists.txt
@@ -0,0 +1,12 @@
+# Generated from qhooks.pro.
+
+#####################################################################
+## tst_qhooks Test:
+#####################################################################
+
+add_qt_test(tst_qhooks
+ SOURCES
+ tst_qhooks.cpp
+ LIBRARIES
+ Qt::CorePrivate
+)
diff --git a/tests/auto/corelib/global/qlogging/CMakeLists.txt b/tests/auto/corelib/global/qlogging/CMakeLists.txt
new file mode 100644
index 0000000000..bd0ab6aeca
--- /dev/null
+++ b/tests/auto/corelib/global/qlogging/CMakeLists.txt
@@ -0,0 +1,25 @@
+if(NOT WINRT)
+ add_qt_executable(qlogging_helper
+ NO_INSTALL # special case
+ OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case
+ SOURCES app/main.cpp
+ DEFINES QT_MESSAGELOGCONTEXT
+ LIBRARIES Qt::Core)
+
+ #special case begin
+ # Fixes required for the backtrace stack to be correct
+ if (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
+ target_link_options(qlogging_helper PRIVATE -rdynamic)
+ endif()
+ set_target_properties(qlogging_helper PROPERTIES CXX_VISIBILITY_PRESET default)
+ # special case end
+endif()
+
+add_qt_test(tst_qlogging SOURCES tst_qlogging.cpp
+ DEFINES
+ QT_MESSAGELOGCONTEXT
+ QT_DISABLE_DEPRECATED_BEFORE=0
+ HELPER_BINARY="${CMAKE_CURRENT_BINARY_DIR}/qlogging_helper" # special case
+)
+
+target_compile_definitions(tst_qlogging PRIVATE QT_CMAKE_BUILD) # special case # to fix the binary name
diff --git a/tests/auto/corelib/global/qlogging/test/test.pro b/tests/auto/corelib/global/qlogging/test/test.pro
index 91896d4494..81445247e0 100644
--- a/tests/auto/corelib/global/qlogging/test/test.pro
+++ b/tests/auto/corelib/global/qlogging/test/test.pro
@@ -19,3 +19,4 @@ SOURCES = ../tst_qlogging.cpp
DEFINES += QT_MESSAGELOGCONTEXT
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
+DEFINES += HELPER_BINARY=\\\"helper\\\"
diff --git a/tests/auto/corelib/global/qlogging/tst_qlogging.cpp b/tests/auto/corelib/global/qlogging/tst_qlogging.cpp
index 3af637d13a..6c6f3a2168 100644
--- a/tests/auto/corelib/global/qlogging/tst_qlogging.cpp
+++ b/tests/auto/corelib/global/qlogging/tst_qlogging.cpp
@@ -792,10 +792,17 @@ void tst_qmessagehandler::qMessagePattern_data()
#define QT_NAMESPACE_STR ""
#endif
+
+#ifdef QT_CMAKE_BUILD
+#define BACKTRACE_HELPER_NAME "qlogging_helper"
+#else
+#define BACKTRACE_HELPER_NAME "helper"
+#endif
+
#ifndef QT_NO_DEBUG
QTest::newRow("backtrace") << "[%{backtrace}] %{message}" << true << (QList<QByteArray>()
// MyClass::qt_static_metacall is explicitly marked as hidden in the Q_OBJECT macro
- << "[MyClass::myFunction|MyClass::mySlot1|?helper?|" QT_NAMESPACE_STR "QMetaMethod::invoke|" QT_NAMESPACE_STR "QMetaObject::invokeMethod] from_a_function 34");
+ << "[MyClass::myFunction|MyClass::mySlot1|?" BACKTRACE_HELPER_NAME "?|" QT_NAMESPACE_STR "QMetaMethod::invoke|" QT_NAMESPACE_STR "QMetaObject::invokeMethod] from_a_function 34");
#endif
QTest::newRow("backtrace depth,separator") << "[%{backtrace depth=2 separator=\"\n\"}] %{message}" << true << (QList<QByteArray>()
@@ -820,9 +827,9 @@ void tst_qmessagehandler::qMessagePattern()
QProcess process;
#ifndef Q_OS_ANDROID
- const QString appExe(QLatin1String("helper"));
+ const QString appExe(QLatin1String(HELPER_BINARY));
#else
- const QString appExe(QCoreApplication::applicationDirPath() + QLatin1String("/libhelper.so"));
+ const QString appExe(QCoreApplication::applicationDirPath() + QLatin1String("/lib" BACKTRACE_HELPER_NAME ".so"));
#endif
//
@@ -870,7 +877,7 @@ void tst_qmessagehandler::setMessagePattern()
QProcess process;
#ifndef Q_OS_ANDROID
- const QString appExe(QLatin1String("helper"));
+ const QString appExe(QLatin1String(HELPER_BINARY));
#else
const QString appExe(QCoreApplication::applicationDirPath() + QLatin1String("/libhelper.so"));
#endif
diff --git a/tests/auto/corelib/global/qnumeric/CMakeLists.txt b/tests/auto/corelib/global/qnumeric/CMakeLists.txt
new file mode 100644
index 0000000000..f96e038c3d
--- /dev/null
+++ b/tests/auto/corelib/global/qnumeric/CMakeLists.txt
@@ -0,0 +1,26 @@
+# Generated from qnumeric.pro.
+
+#####################################################################
+## tst_qnumeric Test:
+#####################################################################
+
+add_qt_test(tst_qnumeric
+ SOURCES
+ tst_qnumeric.cpp
+ LIBRARIES
+ Qt::CorePrivate
+)
+
+## Scopes:
+#####################################################################
+
+extend_target(tst_qnumeric CONDITION ICC
+ COMPILE_OPTIONS
+ -fp-model
+ strict
+)
+
+extend_target(tst_qnumeric CONDITION intel_icl
+ COMPILE_OPTIONS
+ /fp:strict
+)
diff --git a/tests/auto/corelib/global/qrand/CMakeLists.txt b/tests/auto/corelib/global/qrand/CMakeLists.txt
new file mode 100644
index 0000000000..80e8132809
--- /dev/null
+++ b/tests/auto/corelib/global/qrand/CMakeLists.txt
@@ -0,0 +1,10 @@
+# Generated from qrand.pro.
+
+#####################################################################
+## tst_qrand Test:
+#####################################################################
+
+add_qt_test(tst_qrand
+ SOURCES
+ tst_qrand.cpp
+)
diff --git a/tests/auto/corelib/global/qrandomgenerator/CMakeLists.txt b/tests/auto/corelib/global/qrandomgenerator/CMakeLists.txt
new file mode 100644
index 0000000000..23dd440738
--- /dev/null
+++ b/tests/auto/corelib/global/qrandomgenerator/CMakeLists.txt
@@ -0,0 +1,12 @@
+# Generated from qrandomgenerator.pro.
+
+#####################################################################
+## tst_qrandomgenerator Test:
+#####################################################################
+
+add_qt_test(tst_qrandomgenerator
+ SOURCES
+ tst_qrandomgenerator.cpp
+ LIBRARIES
+ Qt::CorePrivate
+)
diff --git a/tests/auto/corelib/global/qtendian/CMakeLists.txt b/tests/auto/corelib/global/qtendian/CMakeLists.txt
new file mode 100644
index 0000000000..80b716f21f
--- /dev/null
+++ b/tests/auto/corelib/global/qtendian/CMakeLists.txt
@@ -0,0 +1,12 @@
+# Generated from qtendian.pro.
+
+#####################################################################
+## tst_qtendian Test:
+#####################################################################
+
+add_qt_test(tst_qtendian
+ SOURCES
+ tst_qtendian.cpp
+ LIBRARIES
+ Qt::CorePrivate
+)