efl/efreet: better printing of test results
authorLucas De Marchi <lucas.demarchi@profusion.mobi>
Mon, 14 Jan 2013 21:04:40 +0000 (21:04 +0000)
committerLucas De Marchi <lucas.demarchi@profusion.mobi>
Mon, 14 Jan 2013 21:04:40 +0000 (21:04 +0000)
Print the name of each test together with the status so it's easier to
check which test failed/passed regardless the test's output:

./src/tests/efreet/efreet_test 2>/dev/null | grep -e "^FINISHED"

The tests themselves should not print to stdout, so we wouldn't need the
grep. But this is already better than we had before.

SVN revision: 82782

src/tests/efreet/main.c

index d5ef3be..e808992 100644 (file)
@@ -149,16 +149,15 @@ main(int argc, char ** argv)
 
         num_tests ++;
 
-        printf("%s:\t\t", tests[i].name);
-        fflush(stdout);
+        printf("Starting \'%s\':\n", tests[i].name);
         start = ecore_time_get();
 
         environ = NULL;
         ret = tests[i].cb();
 
-        printf("%s in %.3f seconds\n", (ret ? "PASSED" : "FAILED"),
-               ecore_time_get() - start);
-        passed += ret;
+        printf("FINISHED \'%s\': %s in %.3f seconds\n", tests[i].name,
+               (ret ? "PASSED" : "FAILED"), ecore_time_get() - start);
+        passed += !!ret;
 
         efreet_shutdown();
      }