Print error if no test cases are run

This commit is contained in:
Nils O. Selåsdal
2014-07-11 16:27:36 +02:00
parent c949961e77
commit f7c27648dc
+4
View File
@@ -81,6 +81,7 @@ main (int argc, char *argv[])
} }
int number_run;
int number_failed = 0; int number_failed = 0;
size_t i; size_t i;
@@ -106,9 +107,12 @@ main (int argc, char *argv[])
srunner_run(sr, NULL, test_case, CK_VERBOSE); srunner_run(sr, NULL, test_case, CK_VERBOSE);
#endif #endif
} }
number_run = srunner_ntests_run(sr);
number_failed = srunner_ntests_failed (sr); number_failed = srunner_ntests_failed (sr);
srunner_free (sr); srunner_free (sr);
if (!number_run)
puts("ERROR: no tests were run");
if (number_failed) if (number_failed)
printf("ERROR: %d tests failed\n", number_failed); printf("ERROR: %d tests failed\n", number_failed);