[gnome-desktop-testing] Add --first-root option



commit d1bca868f80335259d507e12d4e04646d309ce5a
Author: Colin Walters <walters verbum org>
Date:   Sun Feb 9 12:59:41 2014 -0500

    Add --first-root option
    
    This is useful in jhbuild when I often only want the tests from
    that root, rather than also running the system tests.
    
    Perhaps in the future we should optimize this further so that the
    first directory "wins" for tests rather than being merged, e.g.  the
    ostree/ tests in jhbuild win over the system root.

 src/gnome-desktop-testing-runner.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/gnome-desktop-testing-runner.c b/src/gnome-desktop-testing-runner.c
index eaf73cc..5c12547 100755
--- a/src/gnome-desktop-testing-runner.c
+++ b/src/gnome-desktop-testing-runner.c
@@ -182,6 +182,7 @@ load_test (GFile         *prefix_root,
 static TestRunnerApp *app;
 
 static gboolean opt_list;
+static int opt_firstroot;
 static int opt_parallel = 1;
 static char * opt_report_directory;
 static char **opt_dirs;
@@ -192,6 +193,7 @@ static GOptionEntry options[] = {
   { "dir", 'd', 0, G_OPTION_ARG_STRING_ARRAY, &opt_dirs, "Only run tests from these dirs (default: all 
system data dirs)", NULL },
   { "list", 'l', 0, G_OPTION_ARG_NONE, &opt_list, "List matching tests", NULL },
   { "parallel", 'p', 0, G_OPTION_ARG_INT, &opt_parallel, "Specify parallelization to PROC processors; 0 will 
be dynamic)", "PROC" },
+  { "first-root", 0, 0, G_OPTION_ARG_NONE, &opt_firstroot, "Only use first entry in XDG_DATA_DIRS", "PROC" },
   { "report-directory", 0, 0, G_OPTION_ARG_FILENAME, &opt_report_directory, "Create a subdirectory per 
failing test in DIR", "DIR" },
   { "status", 0, 0, G_OPTION_ARG_STRING, &opt_status, "Output status information (yes/no/auto)", NULL },
   { "log-msgid", 0, 0, G_OPTION_ARG_STRING, &opt_log_msgid, "Log unique message with id MSGID=MESSAGE", 
"MSGID" },
@@ -663,6 +665,9 @@ main (int argc, char **argv)
       if (!gather_all_tests_recurse (prefix_root, prefix_root, "", app->tests,
                                      cancellable, error))
         goto out;
+
+      if (opt_firstroot)
+        break;
     }
 
   if (argc > 1)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]