twister: change all occurances of sanitycheck

mass search/replace for sanitycheck replacing it with the new name:
twiser.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2020-12-07 11:40:19 -05:00
commit b18f311b3e
3 changed files with 35 additions and 36 deletions

View file

@ -80,7 +80,7 @@ sys.path.insert(0, os.path.join(ZEPHYR_BASE, "scripts/"))
import scl
import expr_parser
logger = logging.getLogger('sanitycheck')
logger = logging.getLogger('twister')
logger.setLevel(logging.DEBUG)
@ -1078,7 +1078,7 @@ class QEMUHandler(Handler):
except subprocess.TimeoutExpired:
# sometimes QEMU can't handle SIGTERM signal correctly
# in that case kill -9 QEMU process directly and leave
# sanitycheck to judge testing result by console output
# twister to judge testing result by console output
is_timeout = True
if os.path.exists(self.pid_fn):
@ -1476,7 +1476,7 @@ class Platform:
"""
self.name = ""
self.sanitycheck = True
self.twister = True
# if no RAM size is specified by the board, take a default of 128K
self.ram = 128
@ -1501,7 +1501,7 @@ class Platform:
data = scp.data
self.name = data['identifier']
self.sanitycheck = data.get("sanitycheck", True)
self.twister = data.get("twister", True)
# if no RAM size is specified by the board, take a default of 128K
self.ram = data.get("ram", 128)
testing = data.get("testing", {})
@ -1814,11 +1814,11 @@ class TestInstance(DisablePyTestCollectionMixin):
return testcase_runnable and target_ready
def create_overlay(self, platform, enable_asan=False, enable_ubsan=False, enable_coverage=False, coverage_platform=[]):
# Create this in a "sanitycheck/" subdirectory otherwise this
# Create this in a "twister/" subdirectory otherwise this
# will pass this overlay to kconfig.py *twice* and kconfig.cmake
# will silently give that second time precedence over any
# --extra-args=CONFIG_*
subdir = os.path.join(self.build_dir, "sanitycheck")
subdir = os.path.join(self.build_dir, "twister")
content = ""
@ -2039,7 +2039,7 @@ class FilterBuilder(CMake):
def __init__(self, testcase, platform, source_dir, build_dir):
super().__init__(testcase, platform, source_dir, build_dir)
self.log = "config-sanitycheck.log"
self.log = "config-twister.log"
def parse_generated(self):
@ -2455,9 +2455,9 @@ class ProjectBuilder(FilterBuilder):
overlays = extract_overlays(args)
if os.path.exists(os.path.join(instance.build_dir,
"sanitycheck", "testcase_extra.conf")):
"twister", "testcase_extra.conf")):
overlays.append(os.path.join(instance.build_dir,
"sanitycheck", "testcase_extra.conf"))
"twister", "testcase_extra.conf"))
if overlays:
args.append("OVERLAY_CONFIG=\"%s\"" % (" ".join(overlays)))
@ -2739,7 +2739,7 @@ class TestSuite(DisablePyTestCollectionMixin):
if name:
report_name = name
else:
report_name = "sanitycheck"
report_name = "twister"
if report_dir:
os.makedirs(report_dir, exist_ok=True)
@ -2782,7 +2782,7 @@ class TestSuite(DisablePyTestCollectionMixin):
if platform.name in [p.name for p in self.platforms]:
logger.error(f"Duplicate platform {platform.name} in {file}")
raise Exception(f"Duplicate platform identifier {platform.name} found")
if platform.sanitycheck:
if platform.twister:
self.platforms.append(platform)
if platform.default:
self.default_platforms.append(platform.name)
@ -3095,7 +3095,7 @@ class TestSuite(DisablePyTestCollectionMixin):
if not instance_list:
continue
# if sanitycheck was launched with no platform options at all, we
# if twister was launched with no platform options at all, we
# take all default platforms
if default_platforms and not tc.build_on_all:
if tc.platform_allow:

View file

Can't render this file because it is too large.

View file

@ -2,7 +2,7 @@
# vim: set syntax=python ts=4 :
# Copyright (c) 2020 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""Zephyr Sanity Tests
"""Zephyr Test Runner (twister)
Also check the "User and Developer Guides" at https://docs.zephyrproject.org/
@ -80,7 +80,7 @@ pairs:
Set of platforms that this test case should not run on.
extra_sections: <list of extra binary sections>
When computing sizes, sanitycheck will report errors if it finds
When computing sizes, twister will report errors if it finds
extra, unexpected sections in the Zephyr binary unless they are named
here. They will not be included in the size calculation.
@ -150,7 +150,7 @@ pairs:
The set of test cases that actually run depends on directives in the testcase
filed and options passed in on the command line. If there is any confusion,
running with -v or examining the discard report (sanitycheck_discard.csv)
running with -v or examining the discard report (twister_discard.csv)
can help show why particular test cases were skipped.
Metrics (such as pass/fail state and binary size) for the last code
@ -183,9 +183,9 @@ import queue
ZEPHYR_BASE = os.getenv("ZEPHYR_BASE")
if not ZEPHYR_BASE:
# This file has been zephyr/scripts/sanitycheck for years,
# This file has been zephyr/scripts/twister for years,
# and that is not going to change anytime soon. Let the user
# run this script as ./scripts/sanitycheck without making them
# run this script as ./scripts/twister without making them
# set ZEPHYR_BASE.
ZEPHYR_BASE = str(Path(__file__).resolve().parents[1])
@ -208,7 +208,7 @@ sys.path.insert(0, os.path.join(ZEPHYR_BASE, "scripts/pylib/twister"))
from twisterlib import HardwareMap, TestSuite, SizeCalculator, CoverageTool, ExecutionCounter
logger = logging.getLogger('sanitycheck')
logger = logging.getLogger('twister')
logger.setLevel(logging.DEBUG)
def size_report(sc):
@ -254,7 +254,7 @@ def parse_arguments():
case_select = parser.add_argument_group("Test case selection",
"""
Artificially long but functional example:
$ ./scripts/sanitycheck -v \\
$ ./scripts/twister -v \\
--testcase-root tests/ztest/base \\
--testcase-root tests/kernel \\
--test tests/ztest/base/testing.ztest.verbose_0 \\
@ -298,7 +298,7 @@ Artificially long but functional example:
"-f",
"--only-failed",
action="store_true",
help="Run only those tests that failed the previous sanity check "
help="Run only those tests that failed the previous twister run "
"invocation.")
parser.add_argument(
@ -335,7 +335,7 @@ Artificially long but functional example:
help="""Output reports containing results of the test run into the
specified directory.
The output will be both in CSV and JUNIT format
(sanitycheck.csv and sanitycheck.xml).
(twister.csv and twister.xml).
""")
parser.add_argument(
@ -374,7 +374,7 @@ Artificially long but functional example:
help="""Create the filtered list of test cases, but don't actually
run them. Useful if you're just interested in the discard report
generated for every run and saved in the specified output
directory (sanitycheck_discard.csv).
directory (twister_discard.csv).
""")
parser.add_argument("--list-tags", action="store_true",
@ -436,14 +436,13 @@ Artificially long but functional example:
parser.add_argument(
"-m", "--last-metrics", action="store_true",
help="Instead of comparing metrics from the last --release, "
"compare with the results of the previous sanity check "
"compare with the results of the previous twister "
"invocation")
parser.add_argument(
"-u",
"--no-update",
action="store_true",
help="do not update the results of the last run of the sanity "
"checks")
help="do not update the results of the last run of the twister run")
parser.add_argument(
"-G",
@ -513,9 +512,9 @@ Artificially long but functional example:
"--footprint-threshold=0")
parser.add_argument(
"-O", "--outdir",
default=os.path.join(os.getcwd(), "sanity-out"),
default=os.path.join(os.getcwd(), "twister-out"),
help="Output directory for logs and binaries. "
"Default is 'sanity-out' in the current directory. "
"Default is 'twister-out' in the current directory. "
"This directory will be cleaned unless '--no-clean' is set. "
"The '--clobber-output' option controls what cleaning does.")
parser.add_argument(
@ -544,7 +543,7 @@ structure in the main Zephyr tree: boards/<arch>/<board_name>/""")
parser.add_argument(
"-z", "--size", action="append",
help="Don't run sanity checks. Instead, produce a report to "
help="Don't run twister. Instead, produce a report to "
"stdout detailing RAM/ROM sizes on the specified filenames. "
"All other command line arguments ignored.")
parser.add_argument(
@ -580,7 +579,7 @@ structure in the main Zephyr tree: boards/<arch>/<board_name>/""")
prefixed with -D before being passed to CMake.
E.g
"sanitycheck -x=USE_CCACHE=0"
"twister -x=USE_CCACHE=0"
will translate to
"cmake -DUSE_CCACHE=0"
@ -612,7 +611,7 @@ structure in the main Zephyr tree: boards/<arch>/<board_name>/""")
Sanitycheck believes that it interacts with a terminal
when it actually interacts with the script.
E.g "sanitycheck --device-testing
E.g "twister --device-testing
--device-serial-pty <script>
""")
@ -643,7 +642,7 @@ structure in the main Zephyr tree: boards/<arch>/<board_name>/""")
help="""Uses west instead of ninja or make to flash when running with
--device-testing. Supports comma-separated argument list.
E.g "sanitycheck --device-testing --device-serial /dev/ttyACM0
E.g "twister --device-testing --device-serial /dev/ttyACM0
--west-flash="--board-id=foobar,--erase"
will translate to "west flash -- --board-id=foobar --erase"
@ -655,7 +654,7 @@ structure in the main Zephyr tree: boards/<arch>/<board_name>/""")
help="""Uses the specified west runner instead of default when running
with --west-flash.
E.g "sanitycheck --device-testing --device-serial /dev/ttyACM0
E.g "twister --device-testing --device-serial /dev/ttyACM0
--west-flash --west-runner=pyocd"
will translate to "west flash --runner pyocd"
@ -732,7 +731,7 @@ def main():
if os.path.exists(options.outdir):
print("Keeping artifacts untouched")
elif options.last_metrics:
ls = os.path.join(options.outdir, "sanitycheck.csv")
ls = os.path.join(options.outdir, "twister.csv")
if os.path.exists(ls):
with open(ls, "r") as fp:
previous_results = fp.read()
@ -761,7 +760,7 @@ def main():
if options.log_file:
fh = logging.FileHandler(options.log_file)
else:
fh = logging.FileHandler(os.path.join(options.outdir, "sanitycheck.log"))
fh = logging.FileHandler(os.path.join(options.outdir, "twister.log"))
fh.setLevel(logging.DEBUG)
@ -1011,9 +1010,9 @@ def main():
discards = []
if options.report_suffix:
last_run = os.path.join(options.outdir, "sanitycheck_{}.csv".format(options.report_suffix))
last_run = os.path.join(options.outdir, "twister_{}.csv".format(options.report_suffix))
else:
last_run = os.path.join(options.outdir, "sanitycheck.csv")
last_run = os.path.join(options.outdir, "twister.csv")
if options.only_failed:
suite.load_from_file(last_run, filter_status=['skipped', 'passed'])