From: Bastian Dehn Date: Wed, 6 May 2026 06:46:53 +0000 (+0200) Subject: rename run tests only to tests X-Git-Tag: v1.1.30^2~4 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=9d1910cc64deb18d46217c366008f3ad1de0d578;p=sane-kds-s2000w-net.git rename run tests only to tests --- diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 183c214..eca6517 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -16,8 +16,8 @@ message(STATUS "CPPCHECK_VERSION: ${CPPCHECK_VERSION}") file(COPY ${CMAKE_SOURCE_DIR}/src/kds_s2000w_net.conf DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) -add_executable(run_tests - run_tests.c +add_executable(tests + tests.c kds_s2000w_client_mock.c kds_s2000w_net_get_opt_tests.c kds_s2000w_net_set_opt_tests.c @@ -29,16 +29,16 @@ add_executable(run_tests kds_s2000w_image_type_check_tests.c kds_s2000w_pixel_converter_tests.c kds_s2000w_client_mock.c) -add_dependencies(run_tests +add_dependencies(tests sane-kds_s2000w_net-static) -target_link_libraries(run_tests +target_link_libraries(tests ${CMOCKA_LIBRARY} sane-kds_s2000w_net-static) add_custom_target(runningtests - ALL ./run_tests + ALL ./tests WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - DEPENDS run_tests) + DEPENDS tests) add_custom_command(TARGET runningtests POST_BUILD diff --git a/tests/run_tests.c b/tests/run_tests.c deleted file mode 100644 index 4e39ed9..0000000 --- a/tests/run_tests.c +++ /dev/null @@ -1,36 +0,0 @@ -#include "kds_s2000w_client_mock.h" - -typedef int (*testgroupfn)(); - -int run_kds_s2000w_net_get_opt_tests(); -int run_kds_s2000w_net_set_opt_tests(); -int run_kds_s2000w_net_read_tests(); -int run_kds_s2000w_net_tests(); -int run_kds_s2000w_read_config_tests(); -int run_kds_s2000w_image_converter_tests(); -int run_kds_s2000w_option_descriptor_tests(); -int run_kds_s2000w_image_type_check_tests(); -int run_kds_s2000w_pixel_converter_tests(); - -int main() -{ - testgroupfn testgroups[] = { - run_kds_s2000w_net_get_opt_tests, - run_kds_s2000w_net_set_opt_tests, - run_kds_s2000w_net_read_tests, - run_kds_s2000w_net_tests, - run_kds_s2000w_read_config_tests, - run_kds_s2000w_image_converter_tests, - run_kds_s2000w_option_descriptor_tests, - run_kds_s2000w_image_type_check_tests, - run_kds_s2000w_pixel_converter_tests, - }; - - size_t count = sizeof(testgroups) / sizeof(testgroupfn); - for (size_t i = 0; i < count; i++) { - if (testgroups[i]()) - return 1; - } - - return 0; -} \ No newline at end of file diff --git a/tests/tests.c b/tests/tests.c new file mode 100644 index 0000000..4e39ed9 --- /dev/null +++ b/tests/tests.c @@ -0,0 +1,36 @@ +#include "kds_s2000w_client_mock.h" + +typedef int (*testgroupfn)(); + +int run_kds_s2000w_net_get_opt_tests(); +int run_kds_s2000w_net_set_opt_tests(); +int run_kds_s2000w_net_read_tests(); +int run_kds_s2000w_net_tests(); +int run_kds_s2000w_read_config_tests(); +int run_kds_s2000w_image_converter_tests(); +int run_kds_s2000w_option_descriptor_tests(); +int run_kds_s2000w_image_type_check_tests(); +int run_kds_s2000w_pixel_converter_tests(); + +int main() +{ + testgroupfn testgroups[] = { + run_kds_s2000w_net_get_opt_tests, + run_kds_s2000w_net_set_opt_tests, + run_kds_s2000w_net_read_tests, + run_kds_s2000w_net_tests, + run_kds_s2000w_read_config_tests, + run_kds_s2000w_image_converter_tests, + run_kds_s2000w_option_descriptor_tests, + run_kds_s2000w_image_type_check_tests, + run_kds_s2000w_pixel_converter_tests, + }; + + size_t count = sizeof(testgroups) / sizeof(testgroupfn); + for (size_t i = 0; i < count; i++) { + if (testgroups[i]()) + return 1; + } + + return 0; +} \ No newline at end of file