Commit 4b87abf8 authored by Simon Marlow's avatar Simon Marlow
Browse files

clean up the extra_ways machinery

parent 0dc8518a
...@@ -59,8 +59,10 @@ for opt,arg in opts: ...@@ -59,8 +59,10 @@ for opt,arg in opts:
sys.stderr.write("ERROR: requested way \'" + sys.stderr.write("ERROR: requested way \'" +
arg + "\' does not exist\n") arg + "\' does not exist\n")
sys.exit(1) sys.exit(1)
config.run_ways = filter(eq(arg), config.run_ways + config.other_ways) config.cmdline_ways = [arg] + config.cmdline_ways
config.compile_ways = filter(eq(arg), config.compile_ways + config.other_ways) if (arg in config.other_ways):
config.run_ways = [arg] + config.run_ways
config.compile_ways = [arg] + config.compile_ways
if opt == '--skipway': if opt == '--skipway':
if (arg not in config.run_ways and arg not in config.compile_ways and arg not in config.other_ways): if (arg not in config.run_ways and arg not in config.compile_ways and arg not in config.other_ways):
......
...@@ -66,6 +66,10 @@ class TestConfig: ...@@ -66,6 +66,10 @@ class TestConfig:
# libraries. # libraries.
self.compile_ways = [] self.compile_ways = []
self.run_ways = [] self.run_ways = []
self.other_ways = []
# The ways selected via the command line.
self.cmdline_ways = []
# Lists of flags for each way # Lists of flags for each way
self.way_flags = {} self.way_flags = {}
......
...@@ -345,7 +345,9 @@ def test_common_work (name, opts, func, args): ...@@ -345,7 +345,9 @@ def test_common_work (name, opts, func, args):
else: else:
all_ways = ['normal'] all_ways = ['normal']
all_ways = all_ways + opts.extra_ways # A test itself can request extra ways by setting opts.extra_ways
all_ways = all_ways + filter(lambda way: way not in all_ways,
opts.extra_ways)
t.total_test_cases = t.total_test_cases + len(all_ways) t.total_test_cases = t.total_test_cases + len(all_ways)
...@@ -353,6 +355,7 @@ def test_common_work (name, opts, func, args): ...@@ -353,6 +355,7 @@ def test_common_work (name, opts, func, args):
not getTestOpts().skip \ not getTestOpts().skip \
and (config.only == [] or name in config.only) \ and (config.only == [] or name in config.only) \
and (getTestOpts().only_ways == [] or way in getTestOpts().only_ways) \ and (getTestOpts().only_ways == [] or way in getTestOpts().only_ways) \
and (config.cmdline_ways == [] or way in config.cmdline_ways) \
and way not in getTestOpts().omit_ways and way not in getTestOpts().omit_ways
# Which ways we are asked to skip # Which ways we are asked to skip
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment