tests: Print test status after running test
authorKristian Høgsberg <krh@bitplanet.net>
Sat, 3 Mar 2012 03:45:28 +0000 (22:45 -0500)
committerKristian Høgsberg <krh@bitplanet.net>
Sat, 3 Mar 2012 03:45:28 +0000 (22:45 -0500)
This way assert output will be a line by itself, which is easier to read
and lets editors such as emacs step through failed assertions.

tests/test-runner.c

index 80be2f7..a47ea70 100644 (file)
@@ -59,7 +59,6 @@ int main(int argc, char *argv[])
 
        pass = 0;
        for (t = &__start_test_section; t < &__stop_test_section; t++) {
-               fprintf(stderr, "running \"%s\"... ", t->name);
                pid = fork();
                assert(pid >= 0);
                if (pid == 0) { 
@@ -71,6 +70,7 @@ int main(int argc, char *argv[])
                        abort();
                }
 
+               fprintf(stderr, "test \"%s\"... ", t->name);
                switch (info.si_code) {
                case CLD_EXITED:
                        fprintf(stderr, "exit status %d\n", info.si_status);