Commit a97f82b8 authored by Simon Marlow's avatar Simon Marlow

Fix meaning of the only_ways field (fixed cgrun057(normal) in validate)

The default setting for only_ways was [], which meant "all ways".
However, it's really useful to have [] mean "no ways".

In cgrun057 I used only_ways(prof_ways) to mean "only run this in the
profiling ways", but if profiling is disabled then prof_ways = [] and
this doesn't do what we want.  Profiling is normally disabled in
validate, but I had it enabled because I was testing profiling.

So now only_ways defaults to None, which means "all ways", and [] now
means "no ways".
parent e6d25871
......@@ -142,16 +142,16 @@ class TestOptions:
# if not None then we look for namebase.stderr etc rather than
# using the test name
self.with_namebase = None;
self.with_namebase = None
# skip this test?
self.skip = 0;
self.skip = 0
# skip these ways
self.omit_ways = []
# skip all ways except these ([] == do all ways)
self.only_ways = []
# skip all ways except these (None == do all ways)
self.only_ways = None
# add these ways to the default set
self.extra_ways = []
......@@ -576,7 +576,7 @@ def test_common_work (name, opts, func, args):
ok_way = lambda way: \
not getTestOpts().skip \
and (config.only == [] or name in config.only) \
and (getTestOpts().only_ways == [] or way in getTestOpts().only_ways) \
and (getTestOpts().only_ways == None or way in getTestOpts().only_ways) \
and (config.cmdline_ways == [] or way in config.cmdline_ways) \
and way not in getTestOpts().omit_ways
Markdown is supported
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