From: Andrew Cooper Date: Wed, 3 Aug 2016 14:28:41 +0000 (+0100) Subject: Add `./xtf-runner --list --environments` to obtain the full environment list X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=a2148ed1e1b86fd0335f5648319c0035fff82861;p=people%2Fliuw%2Fxtf.git Add `./xtf-runner --list --environments` to obtain the full environment list Signed-off-by: Andrew Cooper --- diff --git a/xtf-runner b/xtf-runner index 034393c..c063699 100755 --- a/xtf-runner +++ b/xtf-runner @@ -413,6 +413,12 @@ def interpret_selection(opts): def list_tests(opts): """ List tests """ + if opts.environments: + # The caller only wants the environment list + for env in sorted(all_environments): + print env + return + if not opts.selection: raise RunnerError("No tests selected") @@ -543,6 +549,10 @@ def main(): " without needing to explicitly name them. --non-default\n" " is available to obtain the non-default categories.\n" "\n" + " The special parameter --environments may be passed to\n" + " get the full list of environments. This option does not\n" + " make sense combined with a selection.\n" + "\n" "Examples:\n" " Listing all tests implemented for hvm32 environment:\n" " ./xtf-runner --list hvm32\n" @@ -578,6 +588,10 @@ def main(): dest = "non_default", help = "Select all non default categories", ) + parser.add_option("--environments", action = "store_true", + dest = "environments", + help = "List all the known environments", + ) parser.add_option("--host", action = "store_true", dest = "host", help = "Restrict selection to applicable" " tests for the current host",