diff options
| author | serpilliere <serpilliere@users.noreply.github.com> | 2017-01-14 23:30:36 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-01-14 23:30:36 +0100 |
| commit | 6fef06f0026aa94db610e223690337949dd39134 (patch) | |
| tree | 0877e68846b7883bd292e11287abcd37787fa110 /test/test_all.py | |
| parent | 29456a7cc09d0a150b517f619858c2eb7fd3a54d (diff) | |
| parent | 0cf75919aed484cf406a24132e1716787cd32ac6 (diff) | |
| download | miasm-6fef06f0026aa94db610e223690337949dd39134.tar.gz miasm-6fef06f0026aa94db610e223690337949dd39134.zip | |
Merge pull request #459 from commial/feature/only-tags
Add a only-tags option for test_all
Diffstat (limited to '')
| -rwxr-xr-x | test/test_all.py | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/test/test_all.py b/test/test_all.py index c710a8ab..e49ce514 100755 --- a/test/test_all.py +++ b/test/test_all.py @@ -57,7 +57,7 @@ class ArchUnitTest(RegressionTest): # script -> blacklisted jitter blacklist = { - "x86/unit/mn_float.py": ["python"], + "x86/unit/mn_float.py": ["python", "llvm"], } for script in ["x86/sem.py", "x86/unit/mn_strings.py", @@ -628,6 +628,9 @@ if __name__ == "__main__": parser.add_argument("-t", "--omit-tags", help="Omit tests based on tags \ (tag1,tag2). Available tags are %s. \ By default, no tag is omitted." % ", ".join(TAGS.keys()), default="") + parser.add_argument("-o", "--only-tags", help="Restrict to tests based on tags \ +(tag1,tag2). Available tags are %s. \ +By default, all tag are considered." % ", ".join(TAGS.keys()), default="") parser.add_argument("-n", "--do-not-clean", help="Do not clean tests products", action="store_true") args = parser.parse_args() @@ -637,16 +640,23 @@ By default, no tag is omitted." % ", ".join(TAGS.keys()), default="") if args.mono is True or args.coverage is True: multiproc = False - ## Parse omit-tags argument + ## Parse omit-tags and only-tags argument exclude_tags = [] - for tag in args.omit_tags.split(","): - if not tag: - continue - if tag not in TAGS: - print "%(red)s[TAG]%(end)s" % cosmetics.colors, \ - "Unkown tag '%s'" % tag - exit(-1) - exclude_tags.append(TAGS[tag]) + include_tags = [] + for dest, src in ((exclude_tags, args.omit_tags), + (include_tags, args.only_tags)): + for tag in src.split(","): + if not tag: + continue + if tag not in TAGS: + print "%(red)s[TAG]%(end)s" % cosmetics.colors, \ + "Unkown tag '%s'" % tag + exit(-1) + dest.append(TAGS[tag]) + + if exclude_tags and include_tags: + print "%(red)s[TAG]%(end)s" % cosmetics.colors, \ + "Omit and Only used together: whitelist mode" # Handle coverage coveragerc = None @@ -736,7 +746,7 @@ By default, no tag is omitted." % ", ".join(TAGS.keys()), default="") # Filter testset according to tags - testset.filter_tags(exclude_tags=exclude_tags) + testset.filter_tags(exclude_tags=exclude_tags, include_tags=include_tags) # Run tests testset.run() |