diff options
Diffstat (limited to 'tests/torture.c')
-rw-r--r-- | tests/torture.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/torture.c b/tests/torture.c index 6fa4c45..6b7484e 100644 --- a/tests/torture.c +++ b/tests/torture.c @@ -24,3 +24,25 @@ void torture_create_case_timeout(Suite *s, const char *name, TFun function, int tcase_add_test(tc_new, function); } +int main(int argc, char **argv) { + Suite *s = NULL; + SRunner *sr = NULL; + struct argument_s arguments; + int nf; + + memset(&arguments,0,sizeof(struct argument_s)); + + torture_cmdline_parse(argc, argv, &arguments); + + s = torture_make_suite(); + + sr = srunner_create(s); + if (arguments.nofork) { + srunner_set_fork_status(sr, CK_NOFORK); + } + srunner_run_all(sr, CK_VERBOSE); + nf = srunner_ntests_failed(sr); + srunner_free(sr); + + return (nf == 0) ? EXIT_SUCCESS : EXIT_FAILURE; +} |