]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
embedded tests: accept and ignore --tap argument
authorSimon McVittie <smcv@debian.org>
Tue, 24 Nov 2015 01:19:27 +0000 (01:19 +0000)
committerSimon McVittie <smcv@debian.org>
Wed, 2 Dec 2015 18:51:08 +0000 (18:51 +0000)
This makes them semi-command-line-compatible with a way we can
invoke the GLib-based tests to get more useful debug logs.

These tests still do not actually produce TAP output yet; I tried
implementing that, but it requires changing a lot of noise on stdout
to come out of stderr, and there was something weird going on with
subprocesses restarting the test numbering which will need further
investigation before making that change.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=93194
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
bus/test-launch-helper.c
bus/test-main.c
bus/test-system.c
dbus/dbus-test-main.c

index e9ba412ac34dad97a75c3383862040047a6a6b52..c58d06ebcce915b7aa401d0380f8fb1d9623bd9c 100644 (file)
@@ -102,7 +102,7 @@ main (int argc, char **argv)
   const char *dir;
   DBusString config_file;
 
-  if (argc > 1)
+  if (argc > 1 && strcmp (argv[1], "--tap") != 0)
     dir = argv[1];
   else
     dir = _dbus_getenv ("DBUS_TEST_DATA");
index 788574fe16e84ba9c39827cc59f65d42dd350256..faa6395566beb6c4e4428e389213358a641fb538 100644 (file)
@@ -95,7 +95,7 @@ main (int argc, char **argv)
 
   progname = argv[0];
 
-  if (argc > 1)
+  if (argc > 1 && strcmp (argv[1], "--tap") != 0)
     dir = argv[1];
   else
     dir = _dbus_getenv ("DBUS_TEST_DATA");
index 5f02d0ab42eae15f63fa711be8767d90c8918e12..2d7848c7e348340b5e7002a52e1412915b1146d5 100644 (file)
@@ -73,7 +73,7 @@ main (int argc, char **argv)
 
   progname = argv[0];
 
-  if (argc > 1)
+  if (argc > 1 && strcmp (argv[1], "--tap") != 0)
     dir = argv[1];
   else
     dir = _dbus_getenv ("DBUS_TEST_DATA");
index 9a80f853b4a7830bacf76b415ea3cf77f9f061f0..08e402b9b6a18496e085887ff9fdce098cc05aad 100644 (file)
@@ -51,7 +51,7 @@ main (int    argc,
   setlocale(LC_ALL, "");
 #endif
   
-  if (argc > 1)
+  if (argc > 1 && strcmp (argv[1], "--tap") != 0)
     test_data_dir = argv[1];
   else
     test_data_dir = NULL;