diff options
author | Alex Merry <alex.merry@kde.org> | 2014-12-28 16:32:13 +0000 |
---|---|---|
committer | Alex Merry <alex.merry@kde.org> | 2014-12-28 17:30:11 +0000 |
commit | f8af407eba5c5ea45be2c6351cf41a7cb44fed21 (patch) | |
tree | 0c3326caf677883ec00e292312213acefe366877 /tests/ECMSetupVersionTest/new_explicit_simple | |
parent | 351fe45dba7ac04ec2779b7d761ac55a58f89945 (diff) | |
download | extra-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_simple')
-rw-r--r-- | tests/ECMSetupVersionTest/new_explicit_simple/CMakeLists.txt | 27 |
1 files changed, 4 insertions, 23 deletions
diff --git a/tests/ECMSetupVersionTest/new_explicit_simple/CMakeLists.txt b/tests/ECMSetupVersionTest/new_explicit_simple/CMakeLists.txt index fa989d61..18b8db1a 100644 --- a/tests/ECMSetupVersionTest/new_explicit_simple/CMakeLists.txt +++ b/tests/ECMSetupVersionTest/new_explicit_simple/CMakeLists.txt @@ -7,28 +7,9 @@ include(ECMSetupVersion) ecm_setup_version(2.3.4 VARIABLE_PREFIX Foo) -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() - -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) +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) add_executable(dummy main.c) |