diff options
author | Rolf Eike Beer <eike@sf-mail.de> | 2012-10-24 17:55:14 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2012-10-31 20:22:42 (GMT) |
commit | d1f3bfe50ecf974c313d0e191475bc4ea18f0c9c (patch) | |
tree | 406f85dc84adb659f76425b49fdd47957b1c058e /Tests/CMakeOnly/CMakeLists.txt | |
parent | f551fa62450379b41b510054948e097582538357 (diff) | |
download | CMake-d1f3bfe50ecf974c313d0e191475bc4ea18f0c9c.zip CMake-d1f3bfe50ecf974c313d0e191475bc4ea18f0c9c.tar.gz CMake-d1f3bfe50ecf974c313d0e191475bc4ea18f0c9c.tar.bz2 |
Tests: add MajorVersionSelection tests
For things where we may have 2 major versions of the same software
installed in parallel (think of Qt and Python) make sure our version
selection gets this right.
Diffstat (limited to 'Tests/CMakeOnly/CMakeLists.txt')
-rw-r--r-- | Tests/CMakeOnly/CMakeLists.txt | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Tests/CMakeOnly/CMakeLists.txt b/Tests/CMakeOnly/CMakeLists.txt index 51a630f..832d7bd 100644 --- a/Tests/CMakeOnly/CMakeLists.txt +++ b/Tests/CMakeOnly/CMakeLists.txt @@ -38,3 +38,21 @@ add_test(CMakeOnly.ProjectInclude ${CMAKE_CMAKE_COMMAND} -DCMAKE_ARGS=-DCMAKE_PROJECT_ProjectInclude_INCLUDE=${CMAKE_CURRENT_SOURCE_DIR}/ProjectInclude/include.cmake -P ${CMAKE_CURRENT_BINARY_DIR}/Test.cmake ) + +include(${CMAKE_SOURCE_DIR}/Modules/CMakeParseArguments.cmake) + +function(add_major_test module) + cmake_parse_arguments(MAJOR_TEST "NOLANG" "VERSION_VAR" "VERSIONS" ${ARGN}) + foreach (_version IN LISTS MAJOR_TEST_VERSIONS) + add_test(CMakeOnly.MajorVersionSelection-${module}_${_version} + ${CMAKE_CMAKE_COMMAND} + -DTEST=MajorVersionSelection-${module}_${_version} + -DTEST_SOURCE=MajorVersionSelection + "-DCMAKE_ARGS=-DMAJOR_TEST_MODULE=${module};-DMAJOR_TEST_VERSION=${_version};-DMAJOR_TEST_NO_LANGUAGES=${MAJOR_TEST_NOLANG};-DMAJOR_TEST_VERSION_VAR=${MAJOR_TEST_VERSION_VAR}" + -P ${CMAKE_CURRENT_BINARY_DIR}/Test.cmake + ) + endforeach () +endfunction() + +add_major_test(PythonLibs VERSIONS 2 3 VERSION_VAR PYTHONLIBS_VERSION_STRING) +add_major_test(PythonInterp NOLANG VERSIONS 2 3 VERSION_VAR PYTHON_VERSION_STRING) |