summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAnas Nashif <anas.nashif@intel.com>2016-10-24 17:08:56 -0400
committerAndrew Boie <andrew.p.boie@intel.com>2016-10-24 22:55:13 +0000
commitdfa86e2aca76fef8401488427f23514e96968d41 (patch)
treeddcb459566823cefdf1ad1ae822b912e7408446f /scripts
parentaf1d1c2d8c91c071c288cf5e3940f74d1458b25f (diff)
sanitycheck: provide option to exclude tags
This will make it possible for us to optimize the list of tests we run, for example, we could exclude footprint tests from the main run because those are run as part of the footprint checks later in the CI job. Use like this: sanitycheck -e footprint Change-Id: I4e7a3aa6fac2ba1c9c99b356f08459da97fda777 Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/sanitycheck15
1 files changed, 13 insertions, 2 deletions
diff --git a/scripts/sanitycheck b/scripts/sanitycheck
index 22b8d2005..beaae8cad 100755
--- a/scripts/sanitycheck
+++ b/scripts/sanitycheck
@@ -1289,7 +1289,7 @@ class TestSuite:
result.append((test, platform))
return result
- def apply_filters(self, platform_filter, arch_filter, tag_filter,
+ def apply_filters(self, platform_filter, arch_filter, tag_filter, exclude_tag,
config_filter, testcase_filter, last_failed, all_plats,
platform_limit, toolchain, extra_args):
instances = []
@@ -1297,6 +1297,7 @@ class TestSuite:
verbose("platform filter: " + str(platform_filter))
verbose(" arch_filter: " + str(arch_filter))
verbose(" tag_filter: " + str(tag_filter))
+ verbose(" exclude_tag: " + str(exclude_tag))
verbose(" config_filter: " + str(config_filter))
if last_failed:
@@ -1329,6 +1330,9 @@ class TestSuite:
if tag_filter and not tc.tags.intersection(tag_filter):
continue
+ if exclude_tag and tc.tags.intersection(exclude_tag):
+ continue
+
if testcase_filter and tc_name not in testcase_filter:
continue
@@ -1409,6 +1413,10 @@ class TestSuite:
discards[instance] = "Command line testcase tag filter"
continue
+ if exclude_tag and tc.tags.intersection(exclude_tag):
+ discards[instance] = "Command line testcase exclude filter"
+ continue
+
if testcase_filter and tc_name not in testcase_filter:
discards[instance] = "Testcase name filter"
continue
@@ -1621,6 +1629,9 @@ def parse_arguments():
help="Specify tags to restrict which tests to run by tag value. "
"Default is to not do any tag filtering. Multiple invocations "
"are treated as a logical 'or' relationship")
+ parser.add_argument("-e", "--exclude-tag", action="append",
+ help="Specify tags of tests that should not run."
+ "Default is to run all tests with all tags.")
parser.add_argument("-f", "--only-failed", action="store_true",
help="Run only those tests that failed the previous sanity check "
"invocation.")
@@ -1830,7 +1841,7 @@ def main():
os.path.join(ZEPHYR_BASE, "samples")]
ts = TestSuite(args.arch_root, args.testcase_root, args.outdir, args.coverage)
- discards = ts.apply_filters(args.platform, args.arch, args.tag, args.config,
+ discards = ts.apply_filters(args.platform, args.arch, args.tag, args.exclude_tag, args.config,
args.test, args.only_failed, args.all,
args.platform_limit, toolchain, args.extra_args)