summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CMakeLists.txt30
-rw-r--r--Tests/RunCMake/CMakeLists.txt4
-rw-r--r--Tests/RunCMake/ExtraGenerators/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/ExtraGenerators/RunCMakeTest.cmake19
-rw-r--r--Tests/RunCMake/ExtraGenerators/Simple.cmake4
5 files changed, 30 insertions, 30 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 38e0460..d913e93 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -746,36 +746,6 @@ if(BUILD_TESTING)
ADD_LINK_FLAGS_TEST(mod_flags_config dll_flags_config)
ADD_LINK_FLAGS_TEST(exe_flags_config mod_flags_config)
- # If we are running right now with a Unix Makefiles or Ninja based generator,
- # build the "Simple" test with the ExtraGenerators, if available
- # This doesn't test whether the generated project files work (unfortunately),
- # mainly it tests that cmake doesn't crash when generating these project files.
- if(CMAKE_GENERATOR MATCHES "^(Unix Makefiles|Ninja)$"
- AND NOT "${CMAKE_CURRENT_BINARY_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
- foreach(
- extraGenerator
- IN ITEMS
- "CodeBlocks"
- "CodeLite"
- "Eclipse CDT4"
- "Kate"
- "Sublime Text 2"
- )
- string(REPLACE " " "" extraGeneratorTestName "Simple_${extraGenerator}Generator")
- add_test(${extraGeneratorTestName} ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/Simple"
- "${CMake_BINARY_DIR}/Tests/${extraGeneratorTestName}"
- --build-two-config
- --build-generator "${extraGenerator} - ${CMAKE_GENERATOR}"
- --build-generator-platform "${CMAKE_GENERATOR_PLATFORM}"
- --build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}"
- --build-project Simple
- --test-command Simple)
- list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${extraGeneratorTestName}")
- endforeach()
- endif()
-
# test for correct sub-project generation
# not implemented in Xcode or Ninja
if(NOT CMAKE_GENERATOR MATCHES "Xcode|Ninja")
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 930122c..e372286 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -323,6 +323,10 @@ endif()
add_RunCMake_test(ExcludeFromAll)
add_RunCMake_test(ExportImport)
add_RunCMake_test(ExternalData)
+if(CMAKE_GENERATOR MATCHES "^(Unix Makefiles|Ninja)$"
+ AND NOT "${CMAKE_CURRENT_BINARY_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
+ add_RunCMake_test(ExtraGenerators)
+endif()
add_RunCMake_test(FeatureSummary)
add_RunCMake_test(FPHSA)
if(CMAKE_USE_SYSTEM_JSONCPP)
diff --git a/Tests/RunCMake/ExtraGenerators/CMakeLists.txt b/Tests/RunCMake/ExtraGenerators/CMakeLists.txt
new file mode 100644
index 0000000..93ee9df
--- /dev/null
+++ b/Tests/RunCMake/ExtraGenerators/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.5)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/ExtraGenerators/RunCMakeTest.cmake b/Tests/RunCMake/ExtraGenerators/RunCMakeTest.cmake
new file mode 100644
index 0000000..fbef79c
--- /dev/null
+++ b/Tests/RunCMake/ExtraGenerators/RunCMakeTest.cmake
@@ -0,0 +1,19 @@
+include(RunCMake)
+
+foreach(
+ extraGenerator
+ IN ITEMS
+ "CodeBlocks"
+ "CodeLite"
+ "Eclipse CDT4"
+ "Kate"
+ "Sublime Text 2"
+ )
+ block()
+ set(RunCMake_GENERATOR "${extraGenerator} - ${RunCMake_GENERATOR}")
+ set(RunCMake_TEST_VARIANT_DESCRIPTION ": ${RunCMake_GENERATOR}")
+ string(REPLACE " " "" extraGeneratorNoSpaces "${extraGenerator}")
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/Simple-${extraGeneratorNoSpaces})
+ run_cmake(Simple)
+ endblock()
+endforeach()
diff --git a/Tests/RunCMake/ExtraGenerators/Simple.cmake b/Tests/RunCMake/ExtraGenerators/Simple.cmake
new file mode 100644
index 0000000..d077046
--- /dev/null
+++ b/Tests/RunCMake/ExtraGenerators/Simple.cmake
@@ -0,0 +1,4 @@
+enable_language(C)
+enable_language(CXX)
+
+add_subdirectory(../../Simple Simple)