From a4c2bce1cef1a823429f73ed66b848c4780d32c3 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Thu, 12 Jul 2018 17:38:04 +0100 Subject: [PATCH] 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 --- bus/test-main.c | 2 +- dbus/dbus-test-main.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bus/test-main.c b/bus/test-main.c index 400ea423..4d101b22 100644 --- a/bus/test-main.c +++ b/bus/test-main.c @@ -102,7 +102,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 4624fd5c..fb1ba018 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 (); -- 2.18.0