Permalink
Browse files

test: loop through all testsuites

  • Loading branch information...
1 parent 43d8fa3 commit a19f8486ac8d1bfe7531444100f40e66e641ba6b @sjaeckel sjaeckel committed Jul 31, 2013
Showing with 11 additions and 5 deletions.
  1. +11 −5 tests/test_chinstrap_main.c
@@ -6,10 +6,16 @@ Suite* scanner_suite (void);
int
main (void)
{
- int number_failed;
- SRunner *sr = srunner_create (scanner_suite());
- srunner_run_all (sr, CK_NORMAL);
- number_failed = srunner_ntests_failed (sr);
- srunner_free (sr);
+ int number_failed = 0;
+ typedef Suite* (*SuiteFun) (void);
+ SuiteFun suites[] = {
+ scanner_suite,
+ };
+ for (size_t i = 0; i < sizeof(suites)/sizeof(suites[0]); ++i) {
+ SRunner *sr = srunner_create (suites[i]());
+ srunner_run_all (sr, CK_NORMAL);
+ number_failed += srunner_ntests_failed (sr);
+ srunner_free (sr);
+ }
return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
}

0 comments on commit a19f848

Please sign in to comment.