]> gitweb.hhaalo.de Git - feierabend.git/commitdiff
add compile option before aug 2026
authorBastian Dehn <hhaalo@arcor.de>
Tue, 7 Jul 2026 16:10:21 +0000 (18:10 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Tue, 7 Jul 2026 16:15:04 +0000 (18:15 +0200)
src/CMakeLists.txt
src/break.c
tests/CMakeLists.txt
tests/break_tests.c

index a1b393605a06fc453ee5c94ef083080bb1c7d3c8..157adffdcfd8e7658160bca696406671c88fcb49 100644 (file)
@@ -9,6 +9,12 @@ set(SOLL_HOUR 8 CACHE STRING "soll Stunden")
 message(STATUS "SOLL_HOUR: ${SOLL_HOUR}")
 set(SOLL_MINUTES 0 CACHE STRING "soll Minuten")
 message(STATUS "SOLL_MINUTES: ${SOLL_MINUTES}")
+option(BEFORE_AUG_2026 OFF)
+message(STATUS "BEFORE_AUG_2026 ${BEFORE_AUG_2026}")
+
+if(${BEFORE_AUG_2026})
+       add_compile_definitions(BEFORE_AUG_2026)
+endif()
 
 configure_file(config.h.in config.h)
 include_directories(${CMAKE_CURRENT_BINARY_DIR} ${LIBXML2_INCLUDE_DIR})
index 09b05cdb23afa81c00f42e991a4c1cdc933298c0..9b089a94bb012169fd438ec29c151f2459296233 100644 (file)
@@ -1,5 +1,6 @@
 #include "break.h"
 
+#ifdef BEFORE_AUG_2026
 #define TWO_HOURS 7200
 #define TWO_HOURS_FIFTEEN_MINUTES 8100
 #define FOUR_HOURS_FIFTY_FIVE_MINUTES 17100
@@ -33,4 +34,5 @@ time_t get_break_time(const time_t worktime)
                return worktime - TWO_HOURS;
 
        return 0;
-}
\ No newline at end of file
+}
+#endif
\ No newline at end of file
index 3601e44a942f0bc30936bacf4181c418d3103db2..b987f9affa51b7f56da361bf198957807410c201 100644 (file)
@@ -1,6 +1,10 @@
 find_library(CMOCKA cmocka REQUIRED)
 message(STATUS "find cmocka: ${CMOCKA}")
 
+if(${BEFORE_AUG_2026})
+       add_compile_definitions(BEFORE_AUG_2026)
+endif()
+
 find_program(CPPCHECK cppcheck REQUIRED)
 message(STATUS "find cppcheck: ${CPPCHECK}")
 execute_process(COMMAND bash -c "${CPPCHECK} --version | sed -z 's/Cppcheck \\(.*\\)\\n$/\\1/'"
index 4a793da75c763ebd5f59b6a4a7d1b6834a3a9453..37494f97253dee25bff2d0e0986901f019ff3401 100644 (file)
@@ -6,6 +6,7 @@
 #include <cmocka.h>
 #include "../src/break.h"
 
+#ifdef BEFORE_AUG_2026
 void two_hours_zero_break_test()
 {
        const time_t worktime = 7200;
@@ -162,4 +163,5 @@ int run_break_tests()
        };
 
        return cmocka_run_group_tests(break_tests, NULL, NULL);
-}
\ No newline at end of file
+}
+#endif
\ No newline at end of file