summaryrefslogtreecommitdiff
path: root/piglit-print-commands.py
diff options
context:
space:
mode:
authorDylan Baker <baker.dylan.c@gmail.com>2013-03-08 11:46:44 -0800
committerJordan Justen <jordan.l.justen@intel.com>2013-03-10 15:20:27 -0700
commit11e264ca913415d26c0dadd72e75c810691b1230 (patch)
tree4b479e752a8a399645eb52bbcecc998fd0df5199 /piglit-print-commands.py
parent8eaa110624660a60c882e66ea95c004e2ea27ae2 (diff)
Move re.compile for regex into Core
Move the re.compile into the core.Enivironment constructor, which reduces code duplication. It also allows us to pass environment data on initilization of the object, rather that having edit it's attributes individually. V2: - Does not remove deprecated options, only marks them as such V3: - Fixes deperecated warning for tests from V2 always being triggered Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Diffstat (limited to 'piglit-print-commands.py')
-rwxr-xr-xpiglit-print-commands.py27
1 files changed, 13 insertions, 14 deletions
diff --git a/piglit-print-commands.py b/piglit-print-commands.py
index 2d8ed8b2b..228ac84b5 100755
--- a/piglit-print-commands.py
+++ b/piglit-print-commands.py
@@ -24,7 +24,6 @@
import argparse
import os.path as path
-import re
import sys, os
import time
import traceback
@@ -64,25 +63,25 @@ def main():
args = parser.parse_args()
- env = core.Environment()
-
- # If --tests is called warn that it is deprecated
+ # Deprecated
+ # --include-tests is the standard going forward, but for backwards
+ # compatability merge args.tests into args.include_tests and drop
+ # duplicates
if args.tests != []:
- print "Warning: Option --tests is deprecated. Use --include-tests"
-
- # Append includes and excludes to env
- for each in args.include_tests:
- env.filter.append(re.compile(each))
- for each in args.tests:
- env.filter.append(re.compile(each))
- for each in args.exclude_tests:
- env.exclude_filter.append(re.compile(each))
+ print "Warnings: Option --tests is deprecated, use --include-tests"
+ args.include_tests = list(set(args.include_tests + args.tests))
+
+ # Set the environment, pass in the included and excluded tests
+ env = core.Environment(
+ exclude_filter=args.exclude_tests,
+ include_filter=args.include_tests,
+ )
# Change to the piglit's path
piglit_dir = path.dirname(path.realpath(sys.argv[0]))
os.chdir(piglit_dir)
- profile = core.loadTestProfile(args.testFile)
+ profile = core.loadTestProfile(args.testProfile)
def getCommand(test):
command = ''