From f8af407eba5c5ea45be2c6351cf41a7cb44fed21 Mon Sep 17 00:00:00 2001 From: Alex Merry Date: Sun, 28 Dec 2014 16:32:13 +0000 Subject: Improve version file tests. Mostly just refatoring to have less duplicated code. --- .../new_project_soversion/CMakeLists.txt | 26 +++------------------- 1 file changed, 3 insertions(+), 23 deletions(-) (limited to 'tests/ECMSetupVersionTest/new_project_soversion') diff --git a/tests/ECMSetupVersionTest/new_project_soversion/CMakeLists.txt b/tests/ECMSetupVersionTest/new_project_soversion/CMakeLists.txt index b2cedd66..c498307b 100644 --- a/tests/ECMSetupVersionTest/new_project_soversion/CMakeLists.txt +++ b/tests/ECMSetupVersionTest/new_project_soversion/CMakeLists.txt @@ -9,28 +9,8 @@ ecm_setup_version(PROJECT SOVERSION 1 ) -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 "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_soversion_VERSION "2.3.4") -strcheck(new_project_soversion_VERSION_STRING "2.3.4") -numcheck(new_project_soversion_VERSION_MAJOR 2) -numcheck(new_project_soversion_VERSION_MINOR 3) -numcheck(new_project_soversion_VERSION_PATCH 4) -numcheck(new_project_soversion_SOVERSION 1) +include(../version_helpers.cmake) +# NB: name comes from project() command +standard_version_var_checks(new_project_soversion 2.3.4 1) add_executable(dummy main.c) -- cgit v1.2.1