diff --git a/CMakeLists.txt b/CMakeLists.txt index 94df9dc..606508a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,6 +16,8 @@ include(Assertion) if(ASSERTION_ENABLE_TESTS) enable_testing() + list(APPEND CMAKE_SCRIPT_TEST_DEFINITIONS CMAKE_MODULE_PATH) + add_cmake_script_test(test/test_add_test.cmake) add_cmake_script_test(test/test_assert_call.cmake) add_cmake_script_test(test/test_assert_number.cmake) diff --git a/test/test_add_test.cmake b/test/test_add_test.cmake index 12e4e13..6f48084 100644 --- a/test/test_add_test.cmake +++ b/test/test_add_test.cmake @@ -1,7 +1,6 @@ cmake_minimum_required(VERSION 3.24) -include(${CMAKE_CURRENT_LIST_DIR}/../cmake/Assertion.cmake - RESULT_VARIABLE ASSERTION_LIST_FILE) +include(Assertion RESULT_VARIABLE ASSERTION_LIST_FILE) set(CMAKELISTS_HEADER "cmake_minimum_required(VERSION 3.24)\n" diff --git a/test/test_assert.cmake b/test/test_assert.cmake index 2c456a9..00eaac9 100644 --- a/test/test_assert.cmake +++ b/test/test_assert.cmake @@ -1,7 +1,6 @@ cmake_minimum_required(VERSION 3.24) -include(${CMAKE_CURRENT_LIST_DIR}/../cmake/Assertion.cmake - RESULT_VARIABLE ASSERTION_LIST_FILE) +include(Assertion RESULT_VARIABLE ASSERTION_LIST_FILE) file(MAKE_DIRECTORY sample-project) diff --git a/test/test_assert_call.cmake b/test/test_assert_call.cmake index a96cd85..c8bc8b9 100644 --- a/test/test_assert_call.cmake +++ b/test/test_assert_call.cmake @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.24) -include(${CMAKE_CURRENT_LIST_DIR}/../cmake/Assertion.cmake) +include(Assertion) function(throw_errors) message(SEND_ERROR "a send error message") diff --git a/test/test_assert_number.cmake b/test/test_assert_number.cmake index 34389ca..5133df6 100644 --- a/test/test_assert_number.cmake +++ b/test/test_assert_number.cmake @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.24) -include(${CMAKE_CURRENT_LIST_DIR}/../cmake/Assertion.cmake) +include(Assertion) set(SEVEN_VAR 7) set(THIRTEEN_VAR 13) diff --git a/test/test_assert_process.cmake b/test/test_assert_process.cmake index 02114de..0e9a951 100644 --- a/test/test_assert_process.cmake +++ b/test/test_assert_process.cmake @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.24) -include(${CMAKE_CURRENT_LIST_DIR}/../cmake/Assertion.cmake) +include(Assertion) section("assert process executions") section("it should assert process executions") diff --git a/test/test_assert_string.cmake b/test/test_assert_string.cmake index bae9047..9639523 100644 --- a/test/test_assert_string.cmake +++ b/test/test_assert_string.cmake @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.24) -include(${CMAKE_CURRENT_LIST_DIR}/../cmake/Assertion.cmake) +include(Assertion) set(STRING_VAR "a string") set(OTHER_STRING_VAR "another string") diff --git a/test/test_assert_version.cmake b/test/test_assert_version.cmake index 6e6f12c..5db54c6 100644 --- a/test/test_assert_version.cmake +++ b/test/test_assert_version.cmake @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.24) -include(${CMAKE_CURRENT_LIST_DIR}/../cmake/Assertion.cmake) +include(Assertion) set(VERSION_VAR 1.2.3) set(VERSIONN_VAR 1.02.3) diff --git a/test/test_fail.cmake b/test/test_fail.cmake index 05d272a..16932ee 100644 --- a/test/test_fail.cmake +++ b/test/test_fail.cmake @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.24) -include(${CMAKE_CURRENT_LIST_DIR}/../cmake/Assertion.cmake) +include(Assertion) section("it should fail with formatted fatal error messages given strings") assert_call(fail "single line string"