aboutsummaryrefslogtreecommitdiff
path: root/tests/ECMSetupVersionTest/new_explicit_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_explicit_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_explicit_version_file_abspath')
-rw-r--r--tests/ECMSetupVersionTest/new_explicit_version_file_abspath/CMakeLists.txt37
1 files changed, 5 insertions, 32 deletions
diff --git a/tests/ECMSetupVersionTest/new_explicit_version_file_abspath/CMakeLists.txt b/tests/ECMSetupVersionTest/new_explicit_version_file_abspath/CMakeLists.txt
index cfe374cc..8fa2b788 100644
--- a/tests/ECMSetupVersionTest/new_explicit_version_file_abspath/CMakeLists.txt
+++ b/tests/ECMSetupVersionTest/new_explicit_version_file_abspath/CMakeLists.txt
@@ -10,38 +10,11 @@ ecm_setup_version(2.3.4
PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/../NewExplicitVersionAbsPath.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)
+project_version_var_checks(1.5.6.7)
+version_var_checks(Foo 2.3.4)
+assert_var_num_value(Foo_SOVERSION 2)
-strcheck(PROJECT_VERSION "1.5.6.7")
-strcheck(PROJECT_VERSION_STRING "1.5.6.7")
-numcheck(PROJECT_VERSION_MAJOR 1)
-numcheck(PROJECT_VERSION_MINOR 5)
-numcheck(PROJECT_VERSION_PATCH 6)
-
-strcheck(Foo_VERSION "2.3.4")
-strcheck(Foo_VERSION_STRING "2.3.4")
-numcheck(Foo_VERSION_MAJOR 2)
-numcheck(Foo_VERSION_MINOR 3)
-numcheck(Foo_VERSION_PATCH 4)
-numcheck(Foo_SOVERSION 2)
-
-set(PACKAGE_FIND_VERSION "2.3.4")
-include("${CMAKE_CURRENT_BINARY_DIR}/../NewExplicitVersionAbsPath.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()
+AnyNewer_2_3_4_checks("${CMAKE_CURRENT_BINARY_DIR}/../NewExplicitVersionAbsPath.cmake")
add_executable(dummy main.c)