From 7e2d485d7522d2190f29028cb8618ebeee69fb4a Mon Sep 17 00:00:00 2001 From: Snaipe Date: Wed, 11 Feb 2015 01:25:48 +0100 Subject: [PATCH] Moved main function in its own CU to avoid symbol conflicts when calling other functions --- Makefile.am | 3 ++- src/main.c | 5 +++++ src/runner.c | 4 ---- 3 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 src/main.c diff --git a/Makefile.am b/Makefile.am index fc4f8b2..00a090d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -40,4 +40,5 @@ libcriterion_la_SOURCES = \ src/process.c \ src/process.h \ src/stats.c \ - src/stats.h + src/stats.h \ + src/main.c diff --git a/src/main.c b/src/main.c new file mode 100644 index 0000000..bcaac01 --- /dev/null +++ b/src/main.c @@ -0,0 +1,5 @@ +#include + +int main(void) { + return criterion_run_all_tests(); +} diff --git a/src/runner.c b/src/runner.c index ddc30fe..e00d4fe 100644 --- a/src/runner.c +++ b/src/runner.c @@ -164,7 +164,3 @@ int criterion_run_all_tests(void) { return strcmp("1", getenv("CRITERION_ALWAYS_SUCCEED") ?: "0") && res; } - -int main(void) { - return criterion_run_all_tests(); -}