build-sys: split test cases in lib/ into their own files
In order to avoid compiling the same source files twice, with and without the TEST_PROGRAM define. Tested that the build still works and that `make distcheck` works as expected. Tested that the test_* programs in lib/ keep working. (Though they are not really invoked by `make check` and in particular test_nsutils is quite useless, test_fileutils also quite poor.) Signed-off-by: Filipe Brandenburger <filbranden@google.com>
This commit is contained in:
@ -8,13 +8,6 @@
|
||||
#include "proc/readproc.h"
|
||||
#include "nsutils.h"
|
||||
|
||||
#ifdef TEST_PROGRAM
|
||||
const char *get_ns_name(int id)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
#endif /* TEST_PROGRAM */
|
||||
|
||||
/* we need to fill in only namespace information */
|
||||
int ns_read(pid_t pid, proc_t *ns_task)
|
||||
{
|
||||
@ -35,11 +28,3 @@ int ns_read(pid_t pid, proc_t *ns_task)
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
#ifdef TEST_PROGRAM
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
printf("Hello, World!\n");
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
#endif /* TEST_PROGRAM */
|
||||
|
Reference in New Issue
Block a user