diff options
author | Alexander Neundorf <neundorf@kde.org> | 2008-08-06 20:16:53 (GMT) |
---|---|---|
committer | Alexander Neundorf <neundorf@kde.org> | 2008-08-06 20:16:53 (GMT) |
commit | e6290446d800b1d27b734ece6782a5add9c1ad4a (patch) | |
tree | 576077116de6fe3feb7f29caae9488d29cf6208f /Tests | |
parent | 397336a24413330b52eb8e9257a59c5e6299f039 (diff) | |
download | CMake-e6290446d800b1d27b734ece6782a5add9c1ad4a.zip CMake-e6290446d800b1d27b734ece6782a5add9c1ad4a.tar.gz CMake-e6290446d800b1d27b734ece6782a5add9c1ad4a.tar.bz2 |
ENH: add simple tests to test that the extra generators don't crash
Alex
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/CMakeLists.txt | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 07037ab..1889a84 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -91,6 +91,55 @@ IF(BUILD_TESTING) ADD_TEST_MACRO(Preprocess Preprocess) ADD_TEST_MACRO(ExportImport ExportImport) + + # If we are running right now with a UnixMakefiles 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_TEST_GENERATOR} MATCHES "Unix Makefiles" OR ${CMAKE_TEST_GENERATOR} MATCHES "KDevelop") + # check which generators we have + EXEC_PROGRAM(${CMAKE_CMAKE_COMMAND} ARGS --help OUTPUT_VARIABLE cmakeOutput ) + # check for the Eclipse generator + IF ("${cmakeOutput}" MATCHES Eclipse) + ADD_TEST(Simple_EclipseGenerator ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/Simple" + "${CMake_BINARY_DIR}/Tests/Simple_EclipseGenerator" + --build-two-config + --build-generator "Eclipse CDT4 - Unix Makefiles" + --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + --build-project Simple + --test-command Simple) + ENDIF ("${cmakeOutput}" MATCHES Eclipse) + + # check for the CodeBlocks generator + IF ("${cmakeOutput}" MATCHES CodeBlocks) + ADD_TEST(Simple_CodeBlocksGenerator ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/Simple" + "${CMake_BINARY_DIR}/Tests/Simple_CodeBlocksGenerator" + --build-two-config + --build-generator "CodeBlocks - Unix Makefiles" + --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + --build-project Simple + --test-command Simple) + ENDIF ("${cmakeOutput}" MATCHES CodeBlocks) + + # check for the KDevelop3 generator + IF ("${cmakeOutput}" MATCHES KDevelop3) + ADD_TEST(Simple_KDevelop3Generator ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/Simple" + "${CMake_BINARY_DIR}/Tests/Simple_KDevelop3Generator" + --build-two-config + --build-generator "KDevelop3 - Unix Makefiles" + --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + --build-project Simple + --test-command Simple) + ENDIF ("${cmakeOutput}" MATCHES CodeBlocks) + + ENDIF(${CMAKE_TEST_GENERATOR} MATCHES "Unix Makefiles" OR ${CMAKE_TEST_GENERATOR} MATCHES "KDevelop") + # test for correct sub-project generation # not implemented in VS6 or Xcode IF(NOT MSVC60 AND NOT XCODE AND NOT MSVC70) |