From 1448861488635af3b69da5b9f15ac87d2dae8cee Mon Sep 17 00:00:00 2001 From: Bastian Dehn Date: Thu, 2 Oct 2025 09:25:21 +0200 Subject: [PATCH] change c99 std and run tests directly --- CMakeLists.txt | 4 ++-- tests/CMakeLists.txt | 8 +++----- 2 files changed, 5 insertions(+), 7 deletions(-) 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 -- 2.47.3