Skip to content

Commit b0cdfd4

Browse files
committed
Propagate exit code from unit tests
Also flag errors more clearly. References #164.
1 parent 8db63a4 commit b0cdfd4

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/main.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,7 @@ int main(int argc, char *argv[])
157157
break;
158158

159159
case 't':
160-
tests();
161-
exit(EXIT_SUCCESS);
162-
break;
160+
return tests();
163161

164162
case 'v':
165163
verbose = 1;

src/minunit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ int tests()
202202
const char *result = all_tests();
203203

204204
if (result != 0) {
205-
printf("%s \n", result);
205+
printf("Error: %s \n", result);
206206

207207
} else {
208208
printf("ALL TESTS PASSED\n");

0 commit comments

Comments
 (0)