]> gitweb.hhaalo.de Git - mv_none_space.git/commitdiff
change c99 std and run tests directly
authorBastian Dehn <hhaalo@arcor.de>
Thu, 2 Oct 2025 07:25:21 +0000 (09:25 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Thu, 2 Oct 2025 07:25:21 +0000 (09:25 +0200)
CMakeLists.txt
tests/CMakeLists.txt

index 35b813c38b9bd491e91e5f65b6ee5d94723f6816..4264e557fe5055f81c62ddf82bf8812d8e8e221c 100644 (file)
@@ -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}")
 
index a9e13ed4c1742932b37b1b2270a1f375ae5614aa..687ff3d7a7c796052cb432ce921f7313dfe6ee7d 100644 (file)
@@ -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