aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorIvan Komissarov <ABBAPOH@gmail.com>2020-08-13 00:45:36 +0200
committerIvan Komissarov <ABBAPOH@gmail.com>2020-08-17 17:09:39 +0000
commitb67b08f1c2c26a226db6f43f2452026f85ad6460 (patch)
treee8aa41c51e6247919d531d9cd35737c98a360ff9 /tests
parent2311a8224c3fc7141c44cc517f4ecdb882cd09f8 (diff)
Initial CMake port
This change allows to build Qbs using CMake build tool Tested platforms - Linux (gcc) - macOS (clang) - Windows (msvc2017) Missing features (compared to Qbs build) - Documentation build - Bundled QtScript support - Static build - .pc file for qbscore - qbs module for qbscore Change-Id: I09b5dadd6723d5a47e5ef2a9a38d3300488718f2 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/CMakeLists.txt3
-rw-r--r--tests/auto/CMakeLists.txt9
-rw-r--r--tests/auto/api/CMakeLists.txt10
-rw-r--r--tests/auto/blackbox/CMakeLists.txt72
-rw-r--r--tests/auto/buildgraph/CMakeLists.txt5
-rw-r--r--tests/auto/cmdlineparser/CMakeLists.txt23
-rw-r--r--tests/auto/language/CMakeLists.txt9
-rw-r--r--tests/auto/tools/CMakeLists.txt7
-rw-r--r--tests/benchmarker/CMakeLists.txt18
-rw-r--r--tests/fuzzy-test/CMakeLists.txt12
10 files changed, 168 insertions, 0 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
new file mode 100644
index 000000000..3a868fbac
--- /dev/null
+++ b/tests/CMakeLists.txt
@@ -0,0 +1,3 @@
+add_subdirectory(auto)
+add_subdirectory(benchmarker)
+add_subdirectory(fuzzy-test)
diff --git a/tests/auto/CMakeLists.txt b/tests/auto/CMakeLists.txt
new file mode 100644
index 000000000..6f6097787
--- /dev/null
+++ b/tests/auto/CMakeLists.txt
@@ -0,0 +1,9 @@
+add_subdirectory(api)
+add_subdirectory(cmdlineparser)
+add_subdirectory(blackbox)
+
+if(WITH_UNIT_TESTS)
+ add_subdirectory(buildgraph)
+ add_subdirectory(language)
+ add_subdirectory(tools)
+endif()
diff --git a/tests/auto/api/CMakeLists.txt b/tests/auto/api/CMakeLists.txt
new file mode 100644
index 000000000..67384d9ac
--- /dev/null
+++ b/tests/auto/api/CMakeLists.txt
@@ -0,0 +1,10 @@
+add_qbs_test(api
+ DEFINES
+ "QBS_RELATIVE_LIBEXEC_PATH=\"${QBS_RELATIVE_LIBEXEC_PATH}\""
+ "QBS_RELATIVE_SEARCH_PATH=\"${QBS_RELATIVE_SEARCH_PATH}\""
+ "QBS_RELATIVE_PLUGINS_PATH=\"${QBS_RELATIVE_PLUGINS_PATH}\""
+ ${QBS_PROJECT_FILE_UPDATES_DEFINES}
+ SOURCES
+ tst_api.cpp
+ tst_api.h
+ )
diff --git a/tests/auto/blackbox/CMakeLists.txt b/tests/auto/blackbox/CMakeLists.txt
new file mode 100644
index 000000000..88eed4b42
--- /dev/null
+++ b/tests/auto/blackbox/CMakeLists.txt
@@ -0,0 +1,72 @@
+add_qbs_test(blackbox
+ DEFINES
+ ${QBS_UNIT_TESTS_DEFINES}
+ SOURCES
+ ../shared.h
+ tst_blackboxbase.cpp
+ tst_blackboxbase.h
+ tst_blackbox.cpp
+ tst_blackbox.h
+ )
+
+add_qbs_test(blackbox-android
+ SOURCES
+ ../shared.h
+ tst_blackboxbase.cpp
+ tst_blackboxbase.h
+ tst_blackboxandroid.cpp
+ tst_blackboxandroid.h
+ )
+
+add_qbs_test(blackbox-apple
+ SOURCES
+ ../shared.h
+ tst_blackboxbase.cpp
+ tst_blackboxbase.h
+ tst_blackboxapple.cpp
+ tst_blackboxapple.h
+ )
+
+add_qbs_test(blackbox-baremetal
+ SOURCES
+ ../shared.h
+ tst_blackboxbase.cpp
+ tst_blackboxbase.h
+ tst_blackboxbaremetal.cpp
+ tst_blackboxbaremetal.h
+ )
+
+add_qbs_test(blackbox-clangdb
+ SOURCES
+ ../shared.h
+ tst_blackboxbase.cpp
+ tst_blackboxbase.h
+ tst_clangdb.cpp
+ tst_clangdb.h
+ )
+
+add_qbs_test(blackbox-java
+ SOURCES
+ ../shared.h
+ tst_blackboxbase.cpp
+ tst_blackboxbase.h
+ tst_blackboxjava.cpp
+ tst_blackboxjava.h
+ )
+
+add_qbs_test(blackbox-joblimits
+ SOURCES
+ ../shared.h
+ tst_blackboxbase.cpp
+ tst_blackboxbase.h
+ tst_blackboxjoblimits.cpp
+ )
+
+add_qbs_test(blackbox-qt
+ SOURCES
+ ../shared.h
+ tst_blackboxbase.cpp
+ tst_blackboxbase.h
+ tst_blackboxqt.cpp
+ tst_blackboxqt.h
+ )
diff --git a/tests/auto/buildgraph/CMakeLists.txt b/tests/auto/buildgraph/CMakeLists.txt
new file mode 100644
index 000000000..a3019295e
--- /dev/null
+++ b/tests/auto/buildgraph/CMakeLists.txt
@@ -0,0 +1,5 @@
+add_qbs_test(buildgraph
+ SOURCES
+ tst_buildgraph.cpp
+ tst_buildgraph.h
+ )
diff --git a/tests/auto/cmdlineparser/CMakeLists.txt b/tests/auto/cmdlineparser/CMakeLists.txt
new file mode 100644
index 000000000..bf072e24d
--- /dev/null
+++ b/tests/auto/cmdlineparser/CMakeLists.txt
@@ -0,0 +1,23 @@
+set(PARSER_SOURCES
+ commandlineoption.cpp
+ commandlineoption.h
+ commandlineoptionpool.cpp
+ commandlineoptionpool.h
+ commandlineparser.cpp
+ commandlineparser.h
+ commandpool.cpp
+ commandpool.h
+ commandtype.h
+ parsercommand.cpp
+ parsercommand.h
+ )
+list_transform_prepend(PARSER_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/../../../src/app/qbs/parser/")
+
+add_qbs_test(cmdlineparser
+ DEFINES
+ "QBS_VERSION=\"${QBS_VERSION}\""
+ INCLUDES
+ "${CMAKE_CURRENT_SOURCE_DIR}/../../../src"
+ SOURCES
+ tst_cmdlineparser.cpp ../../../src/app/qbs/qbstool.cpp ${PARSER_SOURCES}
+ )
diff --git a/tests/auto/language/CMakeLists.txt b/tests/auto/language/CMakeLists.txt
new file mode 100644
index 000000000..008a66fe0
--- /dev/null
+++ b/tests/auto/language/CMakeLists.txt
@@ -0,0 +1,9 @@
+add_qbs_test(language
+ DEFINES
+ "QBS_VERSION=\"${QBS_VERSION}\""
+ DEPENDS
+ Qt5::Script
+ SOURCES
+ tst_language.cpp
+ tst_language.h
+ )
diff --git a/tests/auto/tools/CMakeLists.txt b/tests/auto/tools/CMakeLists.txt
new file mode 100644
index 000000000..a75d998a3
--- /dev/null
+++ b/tests/auto/tools/CMakeLists.txt
@@ -0,0 +1,7 @@
+add_qbs_test(tools
+ DEFINES
+ "QBS_VERSION=\"${QBS_VERSION}\""
+ SOURCES
+ tst_tools.cpp
+ tst_tools.h
+ )
diff --git a/tests/benchmarker/CMakeLists.txt b/tests/benchmarker/CMakeLists.txt
new file mode 100644
index 000000000..d77d6d9c4
--- /dev/null
+++ b/tests/benchmarker/CMakeLists.txt
@@ -0,0 +1,18 @@
+set(SOURCES
+ activities.h
+ benchmarker-main.cpp
+ benchmarker.cpp
+ benchmarker.h
+ commandlineparser.cpp
+ commandlineparser.h
+ exception.h
+ runsupport.cpp
+ runsupport.h
+ valgrindrunner.cpp
+ valgrindrunner.h
+ )
+
+add_qbs_app(qbs_benchmarker
+ DEPENDS Qt5::Core Qt5::Concurrent
+ SOURCES ${SOURCES}
+ )
diff --git a/tests/fuzzy-test/CMakeLists.txt b/tests/fuzzy-test/CMakeLists.txt
new file mode 100644
index 000000000..fe3a1a54e
--- /dev/null
+++ b/tests/fuzzy-test/CMakeLists.txt
@@ -0,0 +1,12 @@
+set(SOURCES
+ commandlineparser.cpp
+ commandlineparser.h
+ fuzzytester.cpp
+ fuzzytester.h
+ main.cpp
+ )
+
+add_qbs_app(qbs_fuzzy-test
+ DEPENDS Qt5::Core
+ SOURCES ${SOURCES}
+ )