summaryrefslogtreecommitdiff
path: root/lib/tinytest/tinytest.c
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2017-12-15 19:41:08 +0200
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2017-12-15 19:41:08 +0200
commitf4ed2dfa942339dc1f174e8a83ff0d41073f1972 (patch)
tree09d596744164c9777c17a377ebbfcfb2b0152f36 /lib/tinytest/tinytest.c
parentdd35fe7ca0e18af0286f89a20e5f743015d3dac5 (diff)
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
Diffstat (limited to 'lib/tinytest/tinytest.c')
-rw-r--r--lib/tinytest/tinytest.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/tinytest/tinytest.c b/lib/tinytest/tinytest.c
index 1ef957d31..01772f3f8 100644
--- a/lib/tinytest/tinytest.c
+++ b/lib/tinytest/tinytest.c
@@ -234,8 +234,9 @@ testcase_run_one(const struct testgroup_t *group,
return SKIP;
}
+ printf("# starting %s%s\n", group->prefix, testcase->name);
if (opt_verbosity>0 && !opt_forked) {
- printf("%s%s: ", group->prefix, testcase->name);
+ //printf("%s%s: ", group->prefix, testcase->name);
} else {
if (opt_verbosity==0) printf(".");
cur_test_prefix = group->prefix;
@@ -252,6 +253,7 @@ testcase_run_one(const struct testgroup_t *group,
outcome = testcase_run_bare_(testcase);
}
+ printf("%s%s: ", group->prefix, testcase->name);
if (outcome == OK) {
++n_ok;
if (opt_verbosity>0 && !opt_forked)
@@ -263,7 +265,8 @@ testcase_run_one(const struct testgroup_t *group,
} else {
++n_bad;
if (!opt_forked)
- printf("\n [%s FAILED]\n", testcase->name);
+ //printf("\n [%s FAILED]\n", testcase->name);
+ puts("FAILED");
}
if (opt_forked) {