2016-02-22 13:28:10 -08:00
|
|
|
#!/usr/bin/env python3
|
2017-04-04 18:47:49 -04:00
|
|
|
# vim: set syntax=python ts=4 :
|
2020-03-24 14:40:28 -04:00
|
|
|
# Copyright (c) 2020 Intel Corporation
|
2019-04-06 09:08:09 -04:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
2020-12-07 11:40:19 -05:00
|
|
|
"""Zephyr Test Runner (twister)
|
2015-07-17 12:03:52 -07:00
|
|
|
|
2019-04-08 14:02:34 -07:00
|
|
|
Also check the "User and Developer Guides" at https://docs.zephyrproject.org/
|
|
|
|
|
2015-07-17 12:03:52 -07:00
|
|
|
This script scans for the set of unit test applications in the git
|
|
|
|
repository and attempts to execute them. By default, it tries to
|
|
|
|
build each test case on one platform per architecture, using a precedence
|
2017-06-16 01:31:54 +03:00
|
|
|
list defined in an architecture configuration file, and if possible
|
2019-06-22 11:04:10 -04:00
|
|
|
run the tests in any available emulators or simulators on the system.
|
2015-07-17 12:03:52 -07:00
|
|
|
|
2017-04-04 18:47:49 -04:00
|
|
|
Test cases are detected by the presence of a 'testcase.yaml' or a sample.yaml
|
|
|
|
files in the application's project directory. This file may contain one or more
|
|
|
|
blocks, each identifying a test scenario. The title of the block is a name for
|
|
|
|
the test case, which only needs to be unique for the test cases specified in
|
2022-03-23 14:07:54 -04:00
|
|
|
that testsuite meta-data. The full canonical name for each test case is <path to
|
2017-04-04 18:47:49 -04:00
|
|
|
test case>/<block>.
|
2015-07-17 12:03:52 -07:00
|
|
|
|
2022-03-23 14:07:54 -04:00
|
|
|
Each test block in the testsuite meta data can define the following key/value
|
2017-12-05 15:28:44 -05:00
|
|
|
pairs:
|
2015-07-17 12:03:52 -07:00
|
|
|
|
2017-10-04 16:14:27 -04:00
|
|
|
tags: <list of tags> (required)
|
2022-03-23 14:07:54 -04:00
|
|
|
A set of string tags for the testsuite. Usually pertains to
|
2015-07-17 12:03:52 -07:00
|
|
|
functional domains but can be anything. Command line invocations
|
|
|
|
of this script can filter the set of tests to run based on tag.
|
|
|
|
|
2017-04-04 18:47:49 -04:00
|
|
|
skip: <True|False> (default False)
|
2022-03-23 14:07:54 -04:00
|
|
|
skip testsuite unconditionally. This can be used for broken tests.
|
2015-10-12 13:10:57 -04:00
|
|
|
|
2017-04-04 18:47:49 -04:00
|
|
|
slow: <True|False> (default False)
|
2019-01-03 14:17:43 -08:00
|
|
|
Don't build or run this test case unless --enable-slow was passed
|
|
|
|
in on the command line. Intended for time-consuming test cases
|
|
|
|
that are only run under certain circumstances, like daily
|
|
|
|
builds.
|
2016-02-10 13:39:00 -08:00
|
|
|
|
2017-04-04 18:47:49 -04:00
|
|
|
extra_args: <list of extra arguments>
|
2017-11-09 12:25:02 +01:00
|
|
|
Extra cache entries to pass to CMake when building or running the
|
2015-07-17 12:03:52 -07:00
|
|
|
test case.
|
|
|
|
|
2017-10-17 09:00:33 -04:00
|
|
|
extra_configs: <list of extra configurations>
|
|
|
|
Extra configuration options to be merged with a master prj.conf
|
|
|
|
when building or running the test case.
|
|
|
|
|
2017-04-04 18:47:49 -04:00
|
|
|
build_only: <True|False> (default False)
|
2019-04-08 14:02:34 -07:00
|
|
|
If true, don't try to run the test even if the selected platform
|
|
|
|
supports it.
|
2015-07-17 12:03:52 -07:00
|
|
|
|
2017-04-04 18:47:49 -04:00
|
|
|
build_on_all: <True|False> (default False)
|
|
|
|
If true, attempt to build test on all available platforms.
|
|
|
|
|
|
|
|
depends_on: <list of features>
|
|
|
|
A board or platform can announce what features it supports, this option
|
|
|
|
will enable the test only those platforms that provide this feature.
|
|
|
|
|
|
|
|
min_ram: <integer>
|
|
|
|
minimum amount of RAM needed for this test to build and run. This is
|
|
|
|
compared with information provided by the board metadata.
|
|
|
|
|
|
|
|
min_flash: <integer>
|
|
|
|
minimum amount of ROM needed for this test to build and run. This is
|
|
|
|
compared with information provided by the board metadata.
|
|
|
|
|
2022-04-18 22:34:39 -04:00
|
|
|
modules: <list of modules>
|
|
|
|
Add list of modules needed for this sample to build and run.
|
|
|
|
|
2017-04-04 18:47:49 -04:00
|
|
|
timeout: <number of seconds>
|
2019-06-22 11:04:10 -04:00
|
|
|
Length of time to run test in emulator before automatically killing it.
|
2015-07-17 12:03:52 -07:00
|
|
|
Default to 60 seconds.
|
|
|
|
|
2020-08-26 11:28:25 -04:00
|
|
|
arch_allow: <list of arches, such as x86, arm, arc>
|
2015-07-17 12:03:52 -07:00
|
|
|
Set of architectures that this test case should only be run for.
|
|
|
|
|
2017-04-04 18:47:49 -04:00
|
|
|
arch_exclude: <list of arches, such as x86, arm, arc>
|
2015-10-05 10:02:45 -04:00
|
|
|
Set of architectures that this test case should not run on.
|
|
|
|
|
2020-08-26 11:28:25 -04:00
|
|
|
platform_allow: <list of platforms>
|
2015-10-05 10:02:45 -04:00
|
|
|
Set of platforms that this test case should only be run for.
|
|
|
|
|
2017-04-04 18:47:49 -04:00
|
|
|
platform_exclude: <list of platforms>
|
2015-10-05 10:02:45 -04:00
|
|
|
Set of platforms that this test case should not run on.
|
2015-07-17 12:03:52 -07:00
|
|
|
|
2017-04-04 18:47:49 -04:00
|
|
|
extra_sections: <list of extra binary sections>
|
2020-12-07 11:40:19 -05:00
|
|
|
When computing sizes, twister will report errors if it finds
|
2016-11-29 12:21:59 -08:00
|
|
|
extra, unexpected sections in the Zephyr binary unless they are named
|
|
|
|
here. They will not be included in the size calculation.
|
|
|
|
|
2017-04-04 18:47:49 -04:00
|
|
|
filter: <expression>
|
2022-03-23 14:07:54 -04:00
|
|
|
Filter whether the testsuite should be run by evaluating an expression
|
2016-03-24 14:46:00 -07:00
|
|
|
against an environment containing the following values:
|
|
|
|
|
|
|
|
{ ARCH : <architecture>,
|
|
|
|
PLATFORM : <platform>,
|
2016-08-08 12:24:59 -05:00
|
|
|
<all CONFIG_* key/value pairs in the test's generated defconfig>,
|
2019-01-09 08:46:42 -05:00
|
|
|
<all DT_* key/value pairs in the test's generated device tree file>,
|
|
|
|
<all CMake key/value pairs in the test's generated CMakeCache.txt file>,
|
2016-08-08 12:24:59 -05:00
|
|
|
*<env>: any environment variable available
|
2016-03-24 14:46:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
The grammar for the expression language is as follows:
|
|
|
|
|
|
|
|
expression ::= expression "and" expression
|
|
|
|
| expression "or" expression
|
|
|
|
| "not" expression
|
|
|
|
| "(" expression ")"
|
|
|
|
| symbol "==" constant
|
|
|
|
| symbol "!=" constant
|
|
|
|
| symbol "<" number
|
|
|
|
| symbol ">" number
|
|
|
|
| symbol ">=" number
|
|
|
|
| symbol "<=" number
|
|
|
|
| symbol "in" list
|
2016-06-02 12:27:54 -07:00
|
|
|
| symbol ":" string
|
2016-03-24 14:46:00 -07:00
|
|
|
| symbol
|
|
|
|
|
|
|
|
list ::= "[" list_contents "]"
|
|
|
|
|
|
|
|
list_contents ::= constant
|
|
|
|
| list_contents "," constant
|
|
|
|
|
|
|
|
constant ::= number
|
|
|
|
| string
|
|
|
|
|
|
|
|
|
|
|
|
For the case where expression ::= symbol, it evaluates to true
|
|
|
|
if the symbol is defined to a non-empty string.
|
|
|
|
|
|
|
|
Operator precedence, starting from lowest to highest:
|
|
|
|
|
|
|
|
or (left associative)
|
|
|
|
and (left associative)
|
|
|
|
not (right associative)
|
|
|
|
all comparison operators (non-associative)
|
|
|
|
|
2020-08-26 11:28:25 -04:00
|
|
|
arch_allow, arch_exclude, platform_allow, platform_exclude
|
2016-03-24 14:46:00 -07:00
|
|
|
are all syntactic sugar for these expressions. For instance
|
|
|
|
|
|
|
|
arch_exclude = x86 arc
|
|
|
|
|
|
|
|
Is the same as:
|
|
|
|
|
|
|
|
filter = not ARCH in ["x86", "arc"]
|
2015-07-17 12:03:52 -07:00
|
|
|
|
2016-06-02 12:27:54 -07:00
|
|
|
The ':' operator compiles the string argument as a regular expression,
|
|
|
|
and then returns a true value only if the symbol's value in the environment
|
2019-07-12 07:54:35 -07:00
|
|
|
matches. For example, if CONFIG_SOC="stm32f107xc" then
|
2016-06-02 12:27:54 -07:00
|
|
|
|
2019-07-12 07:54:35 -07:00
|
|
|
filter = CONFIG_SOC : "stm.*"
|
2016-06-02 12:27:54 -07:00
|
|
|
|
|
|
|
Would match it.
|
|
|
|
|
2022-03-23 14:07:54 -04:00
|
|
|
The set of test cases that actually run depends on directives in the testsuite
|
2022-03-19 08:08:44 -04:00
|
|
|
files and options passed in on the command line. If there is any confusion,
|
|
|
|
running with -v or examining the test plan report (testplan.json)
|
2019-11-20 03:47:27 -08:00
|
|
|
can help show why particular test cases were skipped.
|
2015-07-17 12:03:52 -07:00
|
|
|
|
2016-10-24 18:00:58 -05:00
|
|
|
To load arguments from a file, write '+' before the file name, e.g.,
|
|
|
|
+file_name. File content must be one or more valid arguments separated by
|
|
|
|
line break instead of white spaces.
|
|
|
|
|
2015-07-17 12:03:52 -07:00
|
|
|
Most everyday users will run with no arguments.
|
2019-01-03 14:17:43 -08:00
|
|
|
|
2015-07-17 12:03:52 -07:00
|
|
|
"""
|
|
|
|
|
2019-01-21 15:48:46 +01:00
|
|
|
import os
|
2015-07-17 12:03:52 -07:00
|
|
|
import sys
|
2019-12-06 11:37:40 -05:00
|
|
|
import logging
|
2020-03-24 14:40:28 -04:00
|
|
|
import time
|
|
|
|
import shutil
|
2022-05-23 19:03:28 +09:00
|
|
|
import colorama
|
2020-03-24 14:40:28 -04:00
|
|
|
from colorama import Fore
|
2020-04-13 16:05:44 -07:00
|
|
|
from pathlib import Path
|
2022-06-10 07:27:28 -04:00
|
|
|
|
2020-05-07 12:02:48 -04:00
|
|
|
|
2020-03-24 14:40:28 -04:00
|
|
|
ZEPHYR_BASE = os.getenv("ZEPHYR_BASE")
|
|
|
|
if not ZEPHYR_BASE:
|
2020-12-07 11:40:19 -05:00
|
|
|
# This file has been zephyr/scripts/twister for years,
|
2020-04-13 16:05:44 -07:00
|
|
|
# and that is not going to change anytime soon. Let the user
|
2020-12-07 11:40:19 -05:00
|
|
|
# run this script as ./scripts/twister without making them
|
2020-04-13 16:05:44 -07:00
|
|
|
# set ZEPHYR_BASE.
|
|
|
|
ZEPHYR_BASE = str(Path(__file__).resolve().parents[1])
|
|
|
|
|
|
|
|
# Propagate this decision to child processes.
|
|
|
|
os.environ['ZEPHYR_BASE'] = ZEPHYR_BASE
|
|
|
|
|
|
|
|
print(f'ZEPHYR_BASE unset, using "{ZEPHYR_BASE}"')
|
2020-02-07 17:38:16 -06:00
|
|
|
|
2022-06-23 17:40:57 -04:00
|
|
|
sys.path.insert(0, os.path.join(ZEPHYR_BASE, "scripts/pylib/twister/"))
|
|
|
|
|
|
|
|
from twisterlib.testplan import TestPlan
|
2022-07-19 14:57:42 +02:00
|
|
|
from twisterlib.environment import TwisterEnv, parse_arguments
|
2022-06-23 17:40:57 -04:00
|
|
|
from twisterlib.reports import Reporting
|
|
|
|
from twisterlib.hardwaremap import HardwareMap
|
|
|
|
from twisterlib.coverage import run_coverage
|
|
|
|
from twisterlib.runner import TwisterRunner
|
2019-06-22 11:04:10 -04:00
|
|
|
|
2020-12-07 11:40:19 -05:00
|
|
|
logger = logging.getLogger('twister')
|
2019-12-06 11:37:40 -05:00
|
|
|
logger.setLevel(logging.DEBUG)
|
|
|
|
|
2022-03-16 10:48:05 -04:00
|
|
|
def setup_logging(outdir, log_file, verbose, timestamps):
|
|
|
|
# create file handler which logs even debug messages
|
|
|
|
if log_file:
|
|
|
|
fh = logging.FileHandler(log_file)
|
|
|
|
else:
|
|
|
|
fh = logging.FileHandler(os.path.join(outdir, "twister.log"))
|
|
|
|
|
|
|
|
fh.setLevel(logging.DEBUG)
|
|
|
|
|
|
|
|
# create console handler with a higher log level
|
|
|
|
ch = logging.StreamHandler()
|
|
|
|
|
|
|
|
if verbose > 1:
|
|
|
|
ch.setLevel(logging.DEBUG)
|
|
|
|
else:
|
|
|
|
ch.setLevel(logging.INFO)
|
|
|
|
|
|
|
|
# create formatter and add it to the handlers
|
|
|
|
if timestamps:
|
|
|
|
formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s')
|
|
|
|
else:
|
|
|
|
formatter = logging.Formatter('%(levelname)-7s - %(message)s')
|
|
|
|
|
|
|
|
formatter_file = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
|
|
|
|
ch.setFormatter(formatter)
|
|
|
|
fh.setFormatter(formatter_file)
|
|
|
|
|
|
|
|
# add the handlers to logger
|
|
|
|
logger.addHandler(ch)
|
|
|
|
logger.addHandler(fh)
|
|
|
|
|
2020-03-24 14:40:28 -04:00
|
|
|
|
2022-06-09 14:48:11 -04:00
|
|
|
def init_color(colorama_strip):
|
|
|
|
colorama.init(strip=colorama_strip)
|
|
|
|
|
2019-11-25 08:19:25 -05:00
|
|
|
def main():
|
|
|
|
start_time = time.time()
|
|
|
|
|
2022-06-23 13:16:28 -04:00
|
|
|
options = parse_arguments(sys.argv[1:])
|
2022-03-16 17:56:37 -04:00
|
|
|
|
2022-05-25 03:39:40 +09:00
|
|
|
# Configure color output
|
|
|
|
color_strip = False if options.force_color else None
|
|
|
|
|
|
|
|
colorama.init(strip=color_strip)
|
2022-06-09 14:48:11 -04:00
|
|
|
init_color(colorama_strip=color_strip)
|
2022-05-25 03:39:40 +09:00
|
|
|
|
2020-08-24 18:59:01 -04:00
|
|
|
previous_results = None
|
2019-12-06 11:37:40 -05:00
|
|
|
# Cleanup
|
|
|
|
if options.no_clean or options.only_failed or options.test_only:
|
|
|
|
if os.path.exists(options.outdir):
|
2020-01-02 19:31:20 -08:00
|
|
|
print("Keeping artifacts untouched")
|
2020-08-24 18:59:01 -04:00
|
|
|
elif options.last_metrics:
|
2022-03-19 08:08:44 -04:00
|
|
|
ls = os.path.join(options.outdir, "twister.json")
|
2020-08-24 18:59:01 -04:00
|
|
|
if os.path.exists(ls):
|
|
|
|
with open(ls, "r") as fp:
|
|
|
|
previous_results = fp.read()
|
|
|
|
else:
|
|
|
|
sys.exit(f"Can't compare metrics with non existing file {ls}")
|
2019-12-06 11:37:40 -05:00
|
|
|
elif os.path.exists(options.outdir):
|
2020-01-02 18:44:22 -08:00
|
|
|
if options.clobber_output:
|
|
|
|
print("Deleting output directory {}".format(options.outdir))
|
|
|
|
shutil.rmtree(options.outdir)
|
|
|
|
else:
|
|
|
|
for i in range(1, 100):
|
|
|
|
new_out = options.outdir + ".{}".format(i)
|
|
|
|
if not os.path.exists(new_out):
|
|
|
|
print("Renaming output directory to {}".format(new_out))
|
|
|
|
shutil.move(options.outdir, new_out)
|
|
|
|
break
|
2019-12-06 11:37:40 -05:00
|
|
|
|
2020-08-24 18:59:01 -04:00
|
|
|
previous_results_file = None
|
2019-12-06 11:37:40 -05:00
|
|
|
os.makedirs(options.outdir, exist_ok=True)
|
2020-08-24 18:59:01 -04:00
|
|
|
if options.last_metrics and previous_results:
|
2022-03-19 08:08:44 -04:00
|
|
|
previous_results_file = os.path.join(options.outdir, "baseline.json")
|
2020-08-24 18:59:01 -04:00
|
|
|
with open(previous_results_file, "w") as fp:
|
|
|
|
fp.write(previous_results)
|
2019-12-06 11:37:40 -05:00
|
|
|
|
2020-03-29 19:02:51 -04:00
|
|
|
VERBOSE = options.verbose
|
2022-03-16 10:48:05 -04:00
|
|
|
setup_logging(options.outdir, options.log_file, VERBOSE, options.timestamps)
|
2019-11-25 08:19:25 -05:00
|
|
|
|
2022-06-09 10:18:41 -04:00
|
|
|
env = TwisterEnv(options)
|
|
|
|
env.discover()
|
2022-06-09 14:05:31 -04:00
|
|
|
|
2022-06-12 09:22:19 -04:00
|
|
|
hwm = HardwareMap(env)
|
|
|
|
ret = hwm.discover()
|
|
|
|
if ret == 0:
|
2022-06-13 15:50:32 -04:00
|
|
|
return 0
|
2022-06-12 09:22:19 -04:00
|
|
|
|
2022-06-13 07:43:36 -04:00
|
|
|
env.hwm = hwm
|
|
|
|
|
2022-06-13 17:50:34 -04:00
|
|
|
tplan = TestPlan(env)
|
2022-06-11 16:46:33 -04:00
|
|
|
try:
|
|
|
|
tplan.discover()
|
|
|
|
except RuntimeError as e:
|
|
|
|
logger.error(f"{e}")
|
2022-06-13 15:50:32 -04:00
|
|
|
return 1
|
2019-06-22 11:04:10 -04:00
|
|
|
|
2022-06-11 16:46:33 -04:00
|
|
|
if tplan.report() == 0:
|
2022-06-13 15:50:32 -04:00
|
|
|
return 0
|
2018-02-24 08:32:14 -06:00
|
|
|
|
2022-06-13 11:30:38 -04:00
|
|
|
try:
|
|
|
|
tplan.load()
|
|
|
|
except RuntimeError as e:
|
|
|
|
logger.error(f"{e}")
|
2022-06-13 15:50:32 -04:00
|
|
|
return 1
|
2015-07-17 12:03:52 -07:00
|
|
|
|
2022-03-20 10:18:34 -04:00
|
|
|
if options.list_tests and options.platform:
|
2022-06-11 16:46:33 -04:00
|
|
|
tplan.report_platform_tests(options.platform)
|
2022-06-13 15:50:32 -04:00
|
|
|
return 0
|
2020-05-07 12:02:48 -04:00
|
|
|
|
2022-05-14 09:56:47 -04:00
|
|
|
if VERBOSE > 1:
|
2018-01-13 07:57:42 -05:00
|
|
|
# if we are using command line platform filter, no need to list every
|
|
|
|
# other platform as excluded, we know that already.
|
|
|
|
# Show only the discards that apply to the selected platforms on the
|
|
|
|
# command line
|
|
|
|
|
2022-05-14 09:56:47 -04:00
|
|
|
for i in tplan.instances.values():
|
|
|
|
if i.status == "filtered":
|
|
|
|
if options.platform and i.platform.name not in options.platform:
|
|
|
|
continue
|
|
|
|
logger.debug(
|
|
|
|
"{:<25} {:<50} {}SKIPPED{}: {}".format(
|
|
|
|
i.platform.name,
|
|
|
|
i.testsuite.name,
|
|
|
|
Fore.YELLOW,
|
|
|
|
Fore.RESET,
|
|
|
|
i.reason))
|
2017-09-02 12:32:08 -04:00
|
|
|
|
2019-06-14 13:45:34 -04:00
|
|
|
if options.report_excluded:
|
2022-06-11 16:46:33 -04:00
|
|
|
tplan.report_excluded_tests()
|
2022-06-13 15:50:32 -04:00
|
|
|
return 0
|
2019-06-14 13:45:34 -04:00
|
|
|
|
2022-06-09 10:18:41 -04:00
|
|
|
report = Reporting(tplan, env)
|
2022-07-12 15:16:54 -04:00
|
|
|
plan_file = os.path.join(options.outdir, "testplan.json")
|
|
|
|
if not os.path.exists(plan_file):
|
|
|
|
report.json_report(plan_file)
|
2022-03-19 08:08:44 -04:00
|
|
|
|
2019-06-22 11:04:10 -04:00
|
|
|
if options.save_tests:
|
2022-06-09 10:18:41 -04:00
|
|
|
report.json_report(options.save_tests)
|
2022-06-13 15:50:32 -04:00
|
|
|
return 0
|
2019-06-22 11:04:10 -04:00
|
|
|
|
2020-09-25 09:19:51 -05:00
|
|
|
if options.device_testing and not options.build_only:
|
2019-11-21 12:00:18 -06:00
|
|
|
print("\nDevice testing on:")
|
2022-03-23 13:49:43 -04:00
|
|
|
hwm.dump(filtered=tplan.selected_platforms)
|
2019-11-25 08:19:25 -05:00
|
|
|
print("")
|
2019-11-21 12:00:18 -06:00
|
|
|
|
2017-12-30 13:01:45 -05:00
|
|
|
if options.dry_run:
|
2019-06-22 11:04:10 -04:00
|
|
|
duration = time.time() - start_time
|
2019-12-06 11:37:40 -05:00
|
|
|
logger.info("Completed in %d seconds" % (duration))
|
2022-06-13 15:50:32 -04:00
|
|
|
return 0
|
2015-07-17 12:03:52 -07:00
|
|
|
|
2022-01-14 16:36:01 +01:00
|
|
|
if options.short_build_path:
|
2022-03-23 13:49:43 -04:00
|
|
|
tplan.create_build_dir_links()
|
2022-01-14 16:36:01 +01:00
|
|
|
|
2022-06-10 07:27:28 -04:00
|
|
|
runner = TwisterRunner(tplan.instances, tplan.testsuites, env)
|
2022-06-12 09:22:19 -04:00
|
|
|
runner.duts = hwm.duts
|
2022-06-10 07:27:28 -04:00
|
|
|
runner.run()
|
2022-03-15 13:15:08 -04:00
|
|
|
|
2020-08-24 18:59:01 -04:00
|
|
|
# figure out which report to use for size comparison
|
2022-03-20 10:20:33 -04:00
|
|
|
report_to_use = None
|
2020-08-24 18:59:01 -04:00
|
|
|
if options.compare_report:
|
|
|
|
report_to_use = options.compare_report
|
|
|
|
elif options.last_metrics:
|
|
|
|
report_to_use = previous_results_file
|
|
|
|
|
2022-06-09 10:18:41 -04:00
|
|
|
report.footprint_reports(report_to_use,
|
2020-08-24 18:59:01 -04:00
|
|
|
options.show_footprint,
|
|
|
|
options.all_deltas,
|
|
|
|
options.footprint_threshold,
|
|
|
|
options.last_metrics)
|
2015-07-17 12:03:52 -07:00
|
|
|
|
2022-06-09 10:18:41 -04:00
|
|
|
duration = time.time() - start_time
|
2022-03-15 13:15:08 -04:00
|
|
|
|
2022-06-10 07:27:28 -04:00
|
|
|
runner.results.summary()
|
2020-09-11 13:56:33 -04:00
|
|
|
|
2022-06-10 07:27:28 -04:00
|
|
|
report.summary(runner.results, options.disable_unrecognized_section_test, duration)
|
2019-11-24 07:42:06 -05:00
|
|
|
|
2017-12-30 13:01:45 -05:00
|
|
|
if options.coverage:
|
2022-06-13 07:43:36 -04:00
|
|
|
run_coverage(tplan, options)
|
2016-08-31 14:17:03 +03:00
|
|
|
|
2020-09-25 09:19:51 -05:00
|
|
|
if options.device_testing and not options.build_only:
|
2022-06-13 07:43:36 -04:00
|
|
|
hwm.summary(tplan.selected_platforms)
|
2019-11-25 08:19:25 -05:00
|
|
|
|
2022-06-09 10:18:41 -04:00
|
|
|
report.save_reports(options.report_name,
|
2020-04-22 09:39:42 -04:00
|
|
|
options.report_suffix,
|
2019-12-10 12:26:00 -05:00
|
|
|
options.report_dir,
|
|
|
|
options.no_update,
|
2022-03-30 12:47:06 -04:00
|
|
|
options.platform_reports
|
2020-12-10 11:45:57 -05:00
|
|
|
)
|
2019-12-10 12:26:00 -05:00
|
|
|
|
2020-12-11 07:38:49 -05:00
|
|
|
logger.info("Run completed")
|
2022-06-10 07:27:28 -04:00
|
|
|
if runner.results.failed or runner.results.error or (tplan.warnings and options.warnings_as_errors):
|
2022-06-13 15:50:32 -04:00
|
|
|
return 1
|
|
|
|
|
|
|
|
return 0
|
2017-12-05 15:28:44 -05:00
|
|
|
|
2019-12-12 09:58:28 -05:00
|
|
|
|
2015-07-17 12:03:52 -07:00
|
|
|
if __name__ == "__main__":
|
2022-06-13 15:50:32 -04:00
|
|
|
ret = 0
|
2020-01-02 19:27:40 -08:00
|
|
|
try:
|
2022-06-13 15:50:32 -04:00
|
|
|
ret = main()
|
2020-01-02 19:27:40 -08:00
|
|
|
finally:
|
2021-11-02 16:13:26 +01:00
|
|
|
if (os.name != "nt") and os.isatty(1):
|
|
|
|
# (OS is not Windows) and (stdout is interactive)
|
2020-01-26 05:35:40 -06:00
|
|
|
os.system("stty sane")
|
2022-06-13 15:50:32 -04:00
|
|
|
|
|
|
|
sys.exit(ret)
|