From: Bastian Dehn Date: Thu, 2 Oct 2025 07:25:21 +0000 (+0200) Subject: change c99 std and run tests directly X-Git-Tag: 1.1.1^2~11 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=1448861488635af3b69da5b9f15ac87d2dae8cee;p=mv_none_space.git change c99 std and run tests directly --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 35b813c..4264e55 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,9 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.25.1) IF (CMAKE_BUILD_TYPE STREQUAL "Release") - SET(CMAKE_C_FLAGS "" CACHE STRING "release c flags") + SET(CMAKE_C_FLAGS "-std=c99 -Werror" CACHE STRING "release c flags") ELSE() - SET(CMAKE_C_FLAGS "-g -Wall -fsanitize=address" CACHE STRING "debug c flags") + SET(CMAKE_C_FLAGS "-std=c99 -g -Wall -fsanitize=address" CACHE STRING "debug c flags") ENDIF() MESSAGE(STATUS "CMAKE_C_FLAGS: ${CMAKE_C_FLAGS}") diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index a9e13ed..687ff3d 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -2,13 +2,11 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.25.1) FIND_LIBRARY(cmocka NAMES cmocka REQUIRED) -INCLUDE(CTest) - ADD_EXECUTABLE(rename_tests rename_tests.c ../src/rename.c) TARGET_LINK_LIBRARIES(rename_tests ${cmocka}) -ADD_TEST(NAME rename_tests COMMAND rename_tests) - -ADD_CUSTOM_TARGET(run_tests ALL ctest --verbose DEPENDS rename_tests) \ No newline at end of file +ADD_CUSTOM_TARGET(run_tests + ALL ./rename_tests + DEPENDS rename_tests) \ No newline at end of file