Skip to content

Commit f4ed2df

Browse files
committed
lib/tinytest: Clean up test reporting in the presence of stdout output.
tinytest is written with the idea that tests won't write to stdout, so it prints test name witjout newline, then executes test, then writes status. But MicroPython tests write to stdout, so the test output becomes a mess. So, instead print it like: # starting basics/andor.py ... test output ... basics/andor.py: OK
1 parent dd35fe7 commit f4ed2df

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

lib/tinytest/tinytest.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,9 @@ testcase_run_one(const struct testgroup_t *group,
234234
return SKIP;
235235
}
236236

237+
printf("# starting %s%s\n", group->prefix, testcase->name);
237238
if (opt_verbosity>0 && !opt_forked) {
238-
printf("%s%s: ", group->prefix, testcase->name);
239+
//printf("%s%s: ", group->prefix, testcase->name);
239240
} else {
240241
if (opt_verbosity==0) printf(".");
241242
cur_test_prefix = group->prefix;
@@ -252,6 +253,7 @@ testcase_run_one(const struct testgroup_t *group,
252253
outcome = testcase_run_bare_(testcase);
253254
}
254255

256+
printf("%s%s: ", group->prefix, testcase->name);
255257
if (outcome == OK) {
256258
++n_ok;
257259
if (opt_verbosity>0 && !opt_forked)
@@ -263,7 +265,8 @@ testcase_run_one(const struct testgroup_t *group,
263265
} else {
264266
++n_bad;
265267
if (!opt_forked)
266-
printf("\n [%s FAILED]\n", testcase->name);
268+
//printf("\n [%s FAILED]\n", testcase->name);
269+
puts("FAILED");
267270
}
268271

269272
if (opt_forked) {

0 commit comments

Comments
 (0)