From 1775201647a10923b9f73addf2304c3124350836 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Fri, 23 Jan 2026 18:54:27 +0100 Subject: build: Add DISABLE_TESTS_CORE_DUMPS option We have a few that test that assertions are triggered. This adds a DISABLE_TESTS_CORE_DUMPS CMake build option (default ON) that disables core dumps for tests so they don't pollute the core cache. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- include/test/test.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/test/test.h b/include/test/test.h index b524d8ec..306e737a 100644 --- a/include/test/test.h +++ b/include/test/test.h @@ -29,6 +29,7 @@ #include #include #include +#include #define TEST_RC_SUCCESS 0 #define TEST_RC_SKIP 1 @@ -81,8 +82,13 @@ static int __attribute__((unused)) test_assert_fail(int(* testfunc)(void)) return TEST_RC_FAIL; } - if (pid == 0) + if (pid == 0) { +#ifdef DISABLE_TESTS_CORE_DUMPS + struct rlimit rl = { .rlim_cur = 0, .rlim_max = 0 }; + setrlimit(RLIMIT_CORE, &rl); +#endif return testfunc(); /* should abort */ + } waitpid(pid, &wstatus, 0); #ifdef CONFIG_OUROBOROS_DEBUG -- cgit v1.2.3