scl/test/registry.c

21 lines
436 B
C
Raw Normal View History

#include "registry.h"
2024-10-05 09:24:12 -04:00
#include "unity/unity_internals.h"
#define TESTS_MAX 128
static Test tests[TESTS_MAX];
static int test_count = 0;
void register_test(Test t) {
2024-10-05 09:24:12 -04:00
if (test_count < TESTS_MAX) {
tests[test_count] = t;
test_count++;
} else printf("Maximum number of tests (%d) exceeded.\n", TESTS_MAX);
}
void run_all_tests() {
2024-10-05 09:24:12 -04:00
for (int i = 0; i < test_count; i++) {
int res = tests[i]();
}
}