test: switch the unit tests to something resembling a test suite

The tests have inadvertent dependencies on each other so let's avoid
those by changing to a system that returns a null-terminated list of
test functions and our test runner iterates over those and forks off one
process per function.
This commit is contained in:
Peter Hutterer
2024-01-05 11:26:26 +10:00
parent 133e0d651c
commit 46b579e8d5
26 changed files with 338 additions and 252 deletions

View File

@@ -108,11 +108,13 @@ xfree86_add_comment(void)
free(current);
}
int
const testfunc_t*
xfree86_test(void)
{
xfree86_option_list_duplicate();
xfree86_add_comment();
return 0;
static const testfunc_t testfuncs[] = {
xfree86_option_list_duplicate,
xfree86_add_comment,
NULL,
};
return testfuncs;
}