build-sys: Relocate lib/
test files in lib go to src/tests include/ goes to local/ lib/*.c goes to local/ Signed-off-by: Craig Small <csmall@dropbear.xyz>
This commit is contained in:
29
local/tests.h
Normal file
29
local/tests.h
Normal file
@ -0,0 +1,29 @@
|
||||
|
||||
#ifndef PROCPS_NG_TESTS_H
|
||||
#define PROCPS_NG_TESTS_H
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
typedef int (*TestFunction)(void *data);
|
||||
|
||||
char *testname;
|
||||
|
||||
|
||||
static inline int run_tests(TestFunction *list, void *data)
|
||||
{
|
||||
int i;
|
||||
TestFunction current;
|
||||
|
||||
for (i=0; list[i] != NULL; i++) {
|
||||
testname = NULL;
|
||||
current = list[i];
|
||||
if (!current(data)) {
|
||||
fprintf(stderr, "FAIL: %s\n", testname);
|
||||
return EXIT_FAILURE;
|
||||
} else {
|
||||
fprintf(stderr, "PASS: %s\n", testname);
|
||||
}
|
||||
}
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
#endif
|
Reference in New Issue
Block a user