]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
embedded tests: Make it easier to run a single test-case
authorSimon McVittie <smcv@collabora.com>
Thu, 12 Jul 2018 16:38:04 +0000 (17:38 +0100)
committerSimon McVittie <smcv@collabora.com>
Fri, 16 Nov 2018 15:16:21 +0000 (15:16 +0000)
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 <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://gitlab.freedesktop.org/dbus/dbus/issues/218

bus/test-main.c
dbus/dbus-test-main.c

index ba73a1b46156402a12364e55d7bf399448aa0b61..d2229f7525d89fad5dff369c47e60c942d6b39bf 100644 (file)
@@ -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");
index 4624fd5c927243ecbb4bd9d5c3b745d41e621df7..fb1ba0182765d7fab221fe7b147d67f1697fa728 100644 (file)
@@ -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 ();