From: Bastian Dehn Date: Sat, 30 May 2026 14:06:38 +0000 (+0200) Subject: add test validate versions number X-Git-Tag: 1.1.13^2~5 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=6a09f707e018bf4fbfb8969b2ce02c8c9434e4b4;p=mv-none-space.git add test validate versions number --- diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 2a566bb..d2bb886 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -6,6 +6,7 @@ message(STATUS "find cppcheck: ${CPPCHECK}") execute_process(COMMAND bash -c "${CPPCHECK} --version | sed -z 's/Cppcheck \\(.*\\)\\n$/\\1/'" OUTPUT_VARIABLE CPPCHECK_VERSION) +include_directories(${CMAKE_BINARY_DIR}/src) add_executable(tests tests.c command_validate_tests.c diff --git a/tests/command_validate_tests.c b/tests/command_validate_tests.c index c0d75c5..b337416 100644 --- a/tests/command_validate_tests.c +++ b/tests/command_validate_tests.c @@ -3,8 +3,14 @@ #include #include #include +#include "config.h" #include "../src/command_validate.h" +void validate_version_number() +{ + assert_string_equal(VERSION, "1.1.12"); +} + void validate_number_of_args_ok_test(int argc) { bool valid = validate_number_of_args(argc); @@ -65,6 +71,7 @@ void validate_command_fail_tests() int run_command_validate_tests() { const struct CMUnitTest command_validate_tests[] = { + cmocka_unit_test(validate_version_number), cmocka_unit_test(validate_number_of_args_ok_tests), cmocka_unit_test(validate_number_of_args_fail_tests), cmocka_unit_test(validate_command_ok_tests),