aboutsummaryrefslogtreecommitdiff
path: root/tests/ECMSetupVersionTest/new_project_version_file_abspath
diff options
context:
space:
mode:
authorAlex Merry <alex.merry@kde.org>2014-12-28 16:32:13 +0000
committerAlex Merry <alex.merry@kde.org>2014-12-28 17:30:11 +0000
commitf8af407eba5c5ea45be2c6351cf41a7cb44fed21 (patch)
tree0c3326caf677883ec00e292312213acefe366877 /tests/ECMSetupVersionTest/new_project_version_file_abspath
parent351fe45dba7ac04ec2779b7d761ac55a58f89945 (diff)
downloadextra-cmake-modules-f8af407eba5c5ea45be2c6351cf41a7cb44fed21.tar.gz
extra-cmake-modules-f8af407eba5c5ea45be2c6351cf41a7cb44fed21.tar.bz2
Improve version file tests.
Mostly just refatoring to have less duplicated code.
Diffstat (limited to 'tests/ECMSetupVersionTest/new_project_version_file_abspath')
-rw-r--r--tests/ECMSetupVersionTest/new_project_version_file_abspath/CMakeLists.txt36
1 files changed, 4 insertions, 32 deletions
diff --git a/tests/ECMSetupVersionTest/new_project_version_file_abspath/CMakeLists.txt b/tests/ECMSetupVersionTest/new_project_version_file_abspath/CMakeLists.txt
index bcf22626..5052618e 100644
--- a/tests/ECMSetupVersionTest/new_project_version_file_abspath/CMakeLists.txt
+++ b/tests/ECMSetupVersionTest/new_project_version_file_abspath/CMakeLists.txt
@@ -9,38 +9,10 @@ ecm_setup_version(PROJECT
PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/../NewProjectVersionAbsPath.cmake"
)
-macro(strcheck var val)
- if(NOT ${var} STREQUAL "${val}")
- message(FATAL_ERROR "${var} was ${${var}} instead of ${val}")
- endif()
-endmacro()
-macro(numcheck var val)
- if(NOT ${var} EQUAL "${val}")
- message(FATAL_ERROR "${var} was ${${var}} instead of ${val}")
- endif()
-endmacro()
+include(../version_helpers.cmake)
-strcheck(PROJECT_VERSION "2.3.4")
-strcheck(PROJECT_VERSION_STRING "2.3.4")
-numcheck(PROJECT_VERSION_MAJOR 2)
-numcheck(PROJECT_VERSION_MINOR 3)
-numcheck(PROJECT_VERSION_PATCH 4)
-
-strcheck(new_project_version_file_abspath_VERSION "2.3.4")
-strcheck(new_project_version_file_abspath_VERSION_STRING "2.3.4")
-numcheck(new_project_version_file_abspath_VERSION_MAJOR 2)
-numcheck(new_project_version_file_abspath_VERSION_MINOR 3)
-numcheck(new_project_version_file_abspath_VERSION_PATCH 4)
-numcheck(new_project_version_file_abspath_SOVERSION 2)
-
-set(PACKAGE_FIND_VERSION "2.3.4")
-include("${CMAKE_CURRENT_BINARY_DIR}/../NewProjectVersionAbsPath.cmake")
-strcheck(PACKAGE_VERSION "2.3.4")
-if(NOT PACKAGE_VERSION_COMPATIBLE)
- message(FATAL_ERROR "PACKAGE_VERSION_COMPATIBLE not TRUE")
-endif()
-if(NOT PACKAGE_VERSION_EXACT)
- message(FATAL_ERROR "PACKAGE_VERSION_EXACT not TRUE")
-endif()
+# NB: name comes from project() command
+standard_version_var_checks(new_project_version_file_abspath 2.3.4)
+AnyNewer_2_3_4_checks("${CMAKE_CURRENT_BINARY_DIR}/../NewProjectVersionAbsPath.cmake")
add_executable(dummy main.c)