Skip to content
Snippets Groups Projects
Commit f4ed2dfa authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

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
parent dd35fe7c
Branches
No related tags found
No related merge requests found
...@@ -234,8 +234,9 @@ testcase_run_one(const struct testgroup_t *group, ...@@ -234,8 +234,9 @@ testcase_run_one(const struct testgroup_t *group,
return SKIP; return SKIP;
} }
printf("# starting %s%s\n", group->prefix, testcase->name);
if (opt_verbosity>0 && !opt_forked) { if (opt_verbosity>0 && !opt_forked) {
printf("%s%s: ", group->prefix, testcase->name); //printf("%s%s: ", group->prefix, testcase->name);
} else { } else {
if (opt_verbosity==0) printf("."); if (opt_verbosity==0) printf(".");
cur_test_prefix = group->prefix; cur_test_prefix = group->prefix;
...@@ -252,6 +253,7 @@ testcase_run_one(const struct testgroup_t *group, ...@@ -252,6 +253,7 @@ testcase_run_one(const struct testgroup_t *group,
outcome = testcase_run_bare_(testcase); outcome = testcase_run_bare_(testcase);
} }
printf("%s%s: ", group->prefix, testcase->name);
if (outcome == OK) { if (outcome == OK) {
++n_ok; ++n_ok;
if (opt_verbosity>0 && !opt_forked) if (opt_verbosity>0 && !opt_forked)
...@@ -263,7 +265,8 @@ testcase_run_one(const struct testgroup_t *group, ...@@ -263,7 +265,8 @@ testcase_run_one(const struct testgroup_t *group,
} else { } else {
++n_bad; ++n_bad;
if (!opt_forked) if (!opt_forked)
printf("\n [%s FAILED]\n", testcase->name); //printf("\n [%s FAILED]\n", testcase->name);
puts("FAILED");
} }
if (opt_forked) { if (opt_forked) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment