diff options
author | Marco Trevisan (TreviƱo) <mail@3v1n0.net> | 2019-04-04 23:36:06 -0400 |
---|---|---|
committer | Marco Trevisan <mail@3v1n0.net> | 2019-05-02 19:56:23 +0000 |
commit | 81ae886ddad4b03602dac0a28cb24952e039b462 (patch) | |
tree | 80aaea6e1214c6f16a732a8534719d3ad9788d16 | |
parent | 63c40a97119e6df1a787dc2f604e4992d8986c2c (diff) | |
download | mutter-81ae886ddad4b03602dac0a28cb24952e039b462.tar.gz |
cogl/tests: Use less verbose run-tests.sh on single tests run by meson
Use less verbose output when run-tests.sh is running only a test and we're
requested for less verbose output.
Also write the test name first of running it.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/442
-rw-r--r-- | cogl/tests/conform/meson.build | 1 | ||||
-rwxr-xr-x | cogl/tests/run-tests.sh | 33 | ||||
-rw-r--r-- | cogl/tests/unit/meson.build | 1 |
3 files changed, 21 insertions, 14 deletions
diff --git a/cogl/tests/conform/meson.build b/cogl/tests/conform/meson.build index 9a94eba51..3242f7eec 100644 --- a/cogl/tests/conform/meson.build +++ b/cogl/tests/conform/meson.build @@ -124,6 +124,7 @@ foreach test_target: cogl_conformance_tests test_name = '-'.join(name_parts) test(test_name, cogl_run_tests, suite: ['cogl', 'cogl/conform'], + env: ['RUN_TESTS_QUIET=1'], args: [ cogl_config_env, libmutter_cogl_test_conformance, diff --git a/cogl/tests/run-tests.sh b/cogl/tests/run-tests.sh index eccfc05a6..825dd1251 100755 --- a/cogl/tests/run-tests.sh +++ b/cogl/tests/run-tests.sh @@ -32,13 +32,15 @@ EXIT=0 MISSING_FEATURE="WARNING: Missing required feature"; KNOWN_FAILURE="WARNING: Test is known to fail"; -echo "Key:" -echo "ok = Test passed" -echo "n/a = Driver is missing a feature required for the test" -echo "FAIL = Unexpected failure" -echo "FIXME = Test failed, but it was an expected failure" -echo "PASS! = Unexpected pass" -echo "" +if [ -z "$RUN_TESTS_QUIET" ]; then + echo "Key:" + echo "ok = Test passed" + echo "n/a = Driver is missing a feature required for the test" + echo "FAIL = Unexpected failure" + echo "FIXME = Test failed, but it was an expected failure" + echo "PASS! = Unexpected pass" + echo "" +fi get_status() { @@ -88,6 +90,11 @@ run_test() fi } +if [ -z "$UNIT_TESTS" ]; then + echo Missing unit-tests file or names + exit 1 +fi + TITLE_FORMAT="%35s" printf "$TITLE_FORMAT" "Test" @@ -101,19 +108,18 @@ if test "$HAVE_GLES2" -eq 1; then fi echo "" -echo "" - -if [ -z "$UNIT_TESTS" ]; then - echo Missing unit-tests file or names - exit 1 -fi if [ -f "$UNIT_TESTS" ]; then UNIT_TESTS="$(cat $UNIT_TESTS)" fi +if [ -z "$RUN_TESTS_QUIET" ] || [ "$(echo "$UNIT_TESTS" | wc -w )" -gt 1 ]; then + echo "" +fi + for test in $UNIT_TESTS do + printf $TITLE_FORMAT "$test:" export COGL_DEBUG= if test "$HAVE_GL" -eq 1; then @@ -139,7 +145,6 @@ do run_test "$test" gles2 fi - printf $TITLE_FORMAT "$test:" if test "$HAVE_GL" -eq 1; then printf "$GL_FORMAT" \ "$(get_status "$gl_glsl_result")" \ diff --git a/cogl/tests/unit/meson.build b/cogl/tests/unit/meson.build index 2869764f3..289245e29 100644 --- a/cogl/tests/unit/meson.build +++ b/cogl/tests/unit/meson.build @@ -32,6 +32,7 @@ foreach test_target: cogl_unit_tests test_name = '-'.join(test_target.split('_')) test(test_name, cogl_run_tests, suite: ['cogl', 'cogl/unit'], + env: ['RUN_TESTS_QUIET=1'], args: [ cogl_config_env, libmutter_cogl_test_unit, |