libsel4test: Allow compilation even with no defined test cases. This commit now forces the creation of the special _test_case ELF section, even if the application linking against libsel4test has not defined any tests. In particular, this is in support of upcoming changes to make test case definition and manipulation more explicit in sel4test-driver.
diff --git a/libsel4test/src/test.c b/libsel4test/src/test.c index 9b38194..0f1b1ab 100644 --- a/libsel4test/src/test.c +++ b/libsel4test/src/test.c
@@ -19,6 +19,7 @@ #include <sel4test/prototype.h> #include <sel4test/test.h> +#include <utils/util.h> #define MAX_NAME_SIZE 100 #define STDOUT_CACHE 50000 @@ -155,6 +156,8 @@ extern struct testcase __start__test_case[]; extern struct testcase __stop__test_case[]; +/* Force the _test_case section to be created even if no tests are defined. */ +static USED SECTION("_test_case") struct {} dummy; testcase_t* sel4test_get_test(char *name)