test: parse the LITEST_VERBOSE environment variable

--verbose only works when running a specific test, sometimes we need make
check to be more verbose. Set this by default for make check, the log becomes
a lot more expressive that way

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2015-05-19 10:33:24 +10:00
parent b6eb43b537
commit d05363316c
3 changed files with 17 additions and 0 deletions

View file

@ -63,4 +63,16 @@ $ CK_RUN_SUITE="device:wheel" CK_RUN_CASE="wheel only" ./test/test-device
Check and litest currently do not provide a way to run a specific test
function only.
@section test-verbosity Controlling test output
Each test supports the `--verbose` commandline option to enable debugging
output, see libinput_log_set_priority() for details. The `LITEST_VERBOSE`
environment variable, if set, also enables verbose mode.
@code
$ ./test/test-device --verbose
$ LITEST_VERBOSE=1 make check
@endcode
*/

View file

@ -118,6 +118,8 @@ test_build_linker_LDADD = $(top_builddir)/src/libinput.la $(top_builddir)/src/li
test_build_cxx_SOURCES = build-cxx.cc
test_build_cxx_CXXFLAGS = -Wall -Wextra -Wno-unused-parameter $(AM_CXXFLAGS)
AM_TESTS_ENVIRONMENT= LITEST_VERBOSE=1; export LITEST_VERBOSE;
if HAVE_VALGRIND
VALGRIND_FLAGS=--leak-check=full \
--quiet \

View file

@ -500,6 +500,9 @@ litest_run(int argc, char **argv) {
}
}
if (getenv("LITEST_VERBOSE"))
verbose = 1;
srunner_run_all(sr, CK_ENV);
failed = srunner_ntests_failed(sr);
srunner_free(sr);