[Piglit] [PATCH 1/2] piglit-run.py: Remove deprecated options
Dylan Baker
baker.dylan.c at gmail.com
Thu Jul 25 12:10:36 PDT 2013
Remove deprecated options that were carried over from the getopt =>
argparse conversion. These options were kept as for compatibility, but
marked as deprecated; and their continued existence clutters the code.
Signed-off-by: Dylan Baker <baker.dylan.c at gmail.com>
---
piglit-run.py | 43 +------------------------------------------
1 file changed, 1 insertion(+), 42 deletions(-)
diff --git a/piglit-run.py b/piglit-run.py
index 983e67e..3028116 100755
--- a/piglit-run.py
+++ b/piglit-run.py
@@ -61,33 +61,15 @@ def main():
action = "append",
metavar = "<regex>",
help = "Run only matching tests (can be used more than once)")
- parser.add_argument("--tests",
- default = [],
- action = "append",
- metavar = "<regex>",
- help = "Run only matching tests (can be used more than once) " \
- "DEPRECATED: use --include-tests instead")
parser.add_argument("-x", "--exclude-tests",
default = [],
action = "append",
metavar = "<regex>",
help = "Exclude matching tests (can be used more than once)")
-
- # The new option going forward should be --no-concurrency, but to
- # maintain backwards compatability the --c, --concurrent option should
- # also be maintained. This code allows only one of the two options to be
- # supplied, or it throws an error
- excGroup2 = parser.add_mutually_exclusive_group()
- excGroup2.add_argument("--no-concurrency",
+ parser.add_argument("--no-concurrency",
action = "store_false",
dest = "concurrency",
help = "Disable concurrent test runs")
- excGroup2.add_argument("-c", "--concurrent",
- action = "store",
- metavar = "<boolean>",
- choices = ["1", "0", "on", "off"],
- help = "Deprecated: Turn concrrent runs on or off")
-
parser.add_argument("-p", "--platform",
choices = ["glx", "x11_egl", "wayland", "gbm"],
help = "Name of windows system passed to waffle")
@@ -108,29 +90,6 @@ def main():
if args.platform is not None:
os.environ['PIGLIT_PLATFORM'] = args.platform
- # Deprecated:
- # If the deprecated -c, --concurrent flag is passed, override
- # args.concurrency (which would otherwise be set by the --no-concurrency)
- # flag and print a warning.
- if args.concurrent is not None:
- if (args.concurrent == '1' or args.concurrent == 'on'):
- args.concurrency = True
- print "Warning: Option -c, --concurrent is deprecated, " \
- "concurrent test runs are on by default"
- elif (args.concurrent == '0' or args.concurrent == 'off'):
- args.concurrency = False
- print "Warning: Option -c, --concurrent is deprecated, " \
- "use --no-concurrency for non-concurrent test runs"
- # Ne need for else, since argparse restricts the arguments allowed
-
- # If the deprecated tests option was passed print a warning
- if args.tests != []:
- # This merges any options passed into the --tests option into the
- # ones passed into -t or --tests-include and throws out duplicates
- args.include_tests = list(set(args.include_tests + args.tests))
- print "Warning: Option --tests is deprecated, use " \
- "--include-tests instead"
-
# Always Convert Results Path from Relative path to Actual Path.
resultsDir = path.realpath(args.resultsPath)
--
1.8.3.1
More information about the Piglit
mailing list