[Piglit] [PATCH v3 1/7] Change --tests to --include-tests

Dylan Baker baker.dylan.c at gmail.com
Fri Mar 8 11:46:38 PST 2013


Excluding tests already uses a similar syntax (--exclude-tests), so this
is more consistent.

V2: - Leaves --tests option, but marks it as deprecated

Signed-off-by: Dylan Baker <baker.dylan.c at gmail.com>
---
 piglit-print-commands.py | 12 ++++++++++--
 piglit-run.py            | 12 ++++++++++--
 2 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/piglit-print-commands.py b/piglit-print-commands.py
index 7a3ba14..0d27b77 100755
--- a/piglit-print-commands.py
+++ b/piglit-print-commands.py
@@ -48,8 +48,10 @@ Prints a list of all the tests and how to run them.  Ex:
 
 Options:
   -h, --help                Show this message
-  -t regexp, --tests=regexp Run only matching tests (can be used more
+  -t regexp, --include-tests=regexp Run only matching tests (can be used more
                             than once)
+  --tests=regexp            Run only matching tests (can be used more
+                            than once) DEPRICATED use --include-tests instead
   -x regexp, --exclude-tests=regexp Exclude matching tests (can be used
                             more than once)
 Example:
@@ -71,6 +73,7 @@ def main():
 		option_list = [
 			 "help",
 			 "tests=",
+			 "include-tests=",
 			 "exclude-tests=",
 			 ]
 		options, args = getopt(sys.argv[1:], "ht:x:", option_list)
@@ -85,9 +88,14 @@ def main():
 	for name, value in options:
 		if name in ('-h', '--help'):
 			usage()
-		elif name in ('-t', '--tests'):
+		elif name in ('-t', '--include-tests'):
 			test_filter.append(value)
 			env.filter.append(re.compile(value))
+		elif name in ('--tests'):
+			test_filter.append(value)
+			env.filter.append(re.compile(value))
+			print "Warning: Option --tets is deprecated, " \
+					"use --include-tests instead"
 		elif name in ('-x', '--exclude-tests'):
 			exclude_filter.append(value)
 			env.exclude_filter.append(re.compile(value))
diff --git a/piglit-run.py b/piglit-run.py
index 8da99a0..9d319eb 100755
--- a/piglit-run.py
+++ b/piglit-run.py
@@ -45,8 +45,10 @@ Usage: %(progName)s [options] [profile.tests] [results]
 Options:
   -h, --help                Show this message
   -d, --dry-run             Do not execute the tests
-  -t regexp, --tests=regexp Run only matching tests (can be used more
+  -t regexp, --include-tests=regexp Run only matching tests (can be used more
                             than once)
+  --tests=regexp            Run only matching tests (can be used more
+							than once) DEPRICATED: use --include-tests instead
   -x regexp, --exclude-tests=regexp Excludey matching tests (can be used
                             more than once)
   -n name, --name=name      Name of the testrun
@@ -81,6 +83,7 @@ def main():
 			 "dry-run",
 			 "resume",
 			 "valgrind",
+			 "include-tests=",
 			 "tests=",
 			 "name=",
 			 "exclude-tests=",
@@ -106,9 +109,14 @@ def main():
 			OptionResume = True
 		elif name in ('--valgrind'):
 			env.valgrind = True
-		elif name in ('-t', '--tests'):
+		elif name in ('-t', '--include-tests'):
 			test_filter.append(value)
 			env.filter.append(re.compile(value))
+		elif name in ('--tests'):
+			test_filter.append(value)
+			env.filter.append(re.compile(value))
+			print "Warning: Option --tests is deprecated, " \
+					"use --include-tests instead"
 		elif name in ('-x', '--exclude-tests'):
 			exclude_filter.append(value)
 			env.exclude_filter.append(re.compile(value))
-- 
1.8.1.4



More information about the Piglit mailing list