twister: Add --keep-artifacts option
Introduce a new command-line option `--keep-artifacts` in twister that allows users to specify which artifacts should be preserved during test cleanup in addition to the default set. Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org> Co-authored-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
parent
9ca11f3e9c
commit
09d2a6c08c
2 changed files with 6 additions and 1 deletions
|
@ -578,6 +578,11 @@ structure in the main Zephyr tree: boards/<vendor>/<board_name>/""")
|
|||
which only removes artifacts of passing tests. If you wish to
|
||||
remove all artificats including those of failed tests, use 'all'.""")
|
||||
|
||||
parser.add_argument(
|
||||
"--keep-artifacts", action="append", default=[],
|
||||
help="""Keep specified artifacts when cleaning up at runtime. Multiple invocations
|
||||
are possible."""
|
||||
)
|
||||
test_xor_generator.add_argument(
|
||||
"-N", "--ninja", action="store_true",
|
||||
default=not any(a in sys.argv for a in ("-k", "--make")),
|
||||
|
|
|
@ -1207,7 +1207,7 @@ class ProjectBuilder(FilterBuilder):
|
|||
mode == "passed"
|
||||
or (mode == "all" and self.instance.reason != "CMake build failure")
|
||||
):
|
||||
self.cleanup_artifacts()
|
||||
self.cleanup_artifacts(self.options.keep_artifacts)
|
||||
except StatusAttributeError as sae:
|
||||
logger.error(str(sae))
|
||||
self.instance.status = TwisterStatus.ERROR
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue