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 0741b42a44
commit 6c7cb5c0ab
+4
View File
@@ -81,6 +81,7 @@ main (int argc, char *argv[])
}
int number_run;
int number_failed = 0;
size_t i;
@@ -106,9 +107,12 @@ main (int argc, char *argv[])
srunner_run(sr, NULL, test_case, CK_VERBOSE);
#endif
}
number_run = srunner_ntests_run(sr);
number_failed = srunner_ntests_failed (sr);
srunner_free (sr);
if (!number_run)
puts("ERROR: no tests were run");
if (number_failed)
printf("ERROR: %d tests failed\n", number_failed);