summaryrefslogtreecommitdiff
path: root/piglit-summary-html.py
diff options
context:
space:
mode:
authorDylan Baker <baker.dylan.c@gmail.com>2014-04-03 11:44:17 -0700
committerDylan Baker <baker.dylan.c@gmail.com>2014-04-08 14:29:14 -0700
commit0e4811638d28948ed020245d61c99ace7c1be57f (patch)
treed0e57dd5b5d29ef34e1f7a7ab9bee69ff7ad1b4e /piglit-summary-html.py
parente941caa73459328c1a0af74c98f250ec9e3d0720 (diff)
Add new constant to status with all statuses
This patch adds an authoritative list of statuses in one place as a tuple. This is left as a tuple since a tuple is immutable, but is still ordered. This list is ranked from best to worse (with skip and notrun at the end). Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Diffstat (limited to 'piglit-summary-html.py')
-rwxr-xr-xpiglit-summary-html.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/piglit-summary-html.py b/piglit-summary-html.py
index 4a5172177..58b6823a4 100755
--- a/piglit-summary-html.py
+++ b/piglit-summary-html.py
@@ -34,6 +34,11 @@ sys.path.append(path.dirname(path.realpath(sys.argv[0])))
def main():
+ # Make a copy of the status text list and add all. This is used as the
+ # argument list for -e/--exclude
+ statuses = set(str(s) for s in status.ALL)
+ statuses.add('all')
+
parser = argparse.ArgumentParser()
parser.add_argument("-o", "--overwrite",
action="store_true",
@@ -46,8 +51,7 @@ def main():
parser.add_argument("-e", "--exclude-details",
default=[],
action="append",
- choices=['skip', 'pass', 'warn', 'crash' 'fail',
- 'all'],
+ choices=statuses,
help="Optionally exclude the generation of HTML pages "
"for individual test pages with the status(es) "
"given as arguments. This speeds up HTML "
@@ -71,11 +75,10 @@ def main():
if args.exclude_details:
# If exclude-results has all, then change it to be all
if 'all' in args.exclude_details:
- args.exclude_details = [status.SKIP, status.PASS, status.WARN,
- status.CRASH, status.FAIL]
+ args.exclude_details = status.ALL
else:
- args.exclude_details = [status.status_lookup(i) for i in
- args.exclude_details]
+ args.exclude_details = frozenset(
+ status.status_lookup(i) for i in args.exclude_details)
# if overwrite is requested delete the output directory