From 09d186ab111b03ead39dfc42a55bb417d3b4139b Mon Sep 17 00:00:00 2001 From: Snaipe Date: Fri, 6 Feb 2015 12:46:38 +0100 Subject: [PATCH] Exposed run_all to allow user-defined entry points --- include/criterion/criterion.h | 2 ++ src/runner.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/criterion/criterion.h b/include/criterion/criterion.h index 86b8f4d..0565e69 100644 --- a/include/criterion/criterion.h +++ b/include/criterion/criterion.h @@ -65,4 +65,6 @@ struct criterion_test { }; \ TEST_PROTOTYPE_(Category, Name) +int criterion_run_all_tests(void); + #endif /* !CRITERION_H_ */ diff --git a/src/runner.c b/src/runner.c index dba34f0..40b63b9 100644 --- a/src/runner.c +++ b/src/runner.c @@ -163,7 +163,7 @@ static void run_test(struct criterion_global_stats *stats, struct criterion_test } // TODO: disable & change tests at runtime -int run_all(void) { +int criterion_run_all_tests(void) { report(PRE_EVERYTHING, NULL); smart struct test_set *set = read_all_tests(); smart struct criterion_global_stats *stats = stats_init(); @@ -176,5 +176,5 @@ int run_all(void) { } int main(void) { - return run_all(); + return criterion_run_all_tests(); }