From: Simon McVittie Date: Thu, 12 Jul 2018 16:38:04 +0000 (+0100) Subject: embedded tests: Make it easier to run a single test-case X-Git-Tag: dbus-1.13.8~31 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2908a4da6a4da4d3c86839730808a6a79a2e73e4;p=thirdparty%2Fdbus.git embedded tests: Make it easier to run a single test-case When running tests under "make check" or similar to take advantage of facilities like AM_TESTS_ENVIRONMENT and AX_VALGRIND_CHECK, it's more straightforward to set an environment variable than to pass a command-line option. Signed-off-by: Simon McVittie Reviewed-by: Philip Withnall Bug: https://gitlab.freedesktop.org/dbus/dbus/issues/218 --- diff --git a/bus/test-main.c b/bus/test-main.c index ba73a1b46..d2229f752 100644 --- a/bus/test-main.c +++ b/bus/test-main.c @@ -96,7 +96,7 @@ main (int argc, char **argv) if (argc > 2) only = argv[2]; else - only = NULL; + only = _dbus_getenv ("DBUS_TEST_ONLY"); if (dir == NULL) _dbus_test_fatal ("Must specify test data directory as argv[1] or in DBUS_TEST_DATA env variable"); diff --git a/dbus/dbus-test-main.c b/dbus/dbus-test-main.c index 4624fd5c9..fb1ba0182 100644 --- a/dbus/dbus-test-main.c +++ b/dbus/dbus-test-main.c @@ -61,7 +61,7 @@ main (int argc, if (argc > 2) specific_test = argv[2]; else - specific_test = NULL; + specific_test = _dbus_getenv ("DBUS_TEST_ONLY"); _dbus_run_tests (test_data_dir, specific_test); return _dbus_test_done_testing ();