fprintf(stdout, "%s [<options>] [<test-data-dir>] [<specific-test>]\n", appname);
fprintf(stdout, "Options:\n");
fprintf(stdout, " --help this page\n");
+ fprintf(stdout, " --list-tests show available tests\n");
fprintf(stdout, " --tap expect test data dir to be set by environment variable DBUS_TEST_DATA\n");
fprintf(stdout, "Environment variables:\n");
fprintf(stdout, " DBUS_TEST_ONLY=<specific-test> set specific test to run\n");
fprintf(stdout, " DBUS_TEST_DATA=<test-data-dir> set test data dir (required when using --tap)\n");
}
+static void
+_dbus_test_show_available_tests (const DBusTestCase *tests)
+{
+ const DBusTestCase *p;
+
+ for (p = tests; p->name; p++)
+ fprintf(stdout, "%s\n", p->name);
+}
+
/*
* _dbus_test_main:
* @argc: number of command-line arguments
exit(0);
}
+ else if (argc > 1 && strcmp (argv[1], "--list-tests") == 0)
+ {
+ _dbus_test_show_available_tests (tests);
+ exit (0);
+ }
+
/* We can't assume that strings from _dbus_getenv() will remain valid
* forever, because some tests call setenv(), which is allowed to
* reallocate the entire environment block, and in Wine it seems that it