Lines Matching +full:- +full:- +full:timeout +full:- +full:multiplier

4 # Copyright (c) 2018-2025 Intel Corporation
8 # SPDX-License-Identifier: Apache-2.0
45 def _get_installed_packages() -> Generator[str, None, None]:
63 PYTEST_PLUGIN_INSTALLED = 'pytest-twister-harness' in installed_packages
71 def add_parse_arguments(parser = None) -> argparse.ArgumentParser:
82 $ ./scripts/twister -v \\
83 --testsuite-root tests/ztest/base \\
84 --testsuite-root tests/kernel \\
85 --test tests/ztest/base/testing.ztest.verbose_0 \\
86 --test tests/kernel/fifo/fifo_api/kernel.fifo
94 description="Report the composed test plan details and exit (dry-run)."
124 "-E",
125 "--save-tests",
133 "-F",
134 "--load-tests",
142 "-T", "--testsuite-root", action="append", default=[], type = norm_path,
149 "-f",
150 "--only-failed",
155 test_plan_report_xor.add_argument("--list-tests", action="store_true",
156 help="""List of all sub-test functions recursively found in
157 all --testsuite-root arguments. The output is flattened and reports detailed
158 sub-test names without their directories.
159 Note: sub-test names can share the same test scenario identifier prefix
163 test_plan_report_xor.add_argument("--test-tree", action="store_true",
167 "-G",
168 "--integration",
173 "--emulation-only", action="store_true",
177 "--device-testing", action="store_true",
179 "use with the --device-serial option.")
181 run_group_option.add_argument("--generate-hardware-map",
184 --device-testing
188 "--simulation", dest="sim_name", choices=SUPPORTED_SIMS,
194 device.add_argument("--device-serial",
199 device.add_argument("--device-serial-pty",
204 E.g "twister --device-testing
205 --device-serial-pty <script>
208 device.add_argument("--hardware-map",
213 parser.add_argument("--device-flash-timeout", type=int, default=60,
214 help="""Set timeout for the device flash operation in seconds.
217 parser.add_argument("--device-flash-with-test", action="store_true",
218 help="""Add a test case timeout to the flash operation timeout
222 parser.add_argument("--flash-before", action="store_true", default=False,
225 and serial console, or use soft-USB, where flash must come first.
229 "-b",
230 "--build-only",
232 default="--prep-artifacts-for-testing" in sys.argv,
237 "--prep-artifacts-for-testing", action="store_true",
242 "--package-artifacts",
243 help="Package artifacts needed for flashing in a file to be used with --test-only"
247 "--test-only", action="store_true",
251 parser.add_argument("--timeout-multiplier", type=float, default=1,
252 help="""Globally adjust tests timeouts by specified multiplier. The resulting test
253 timeout would be multiplication of test timeout value, board-level timeout multiplier
254 and global timeout multiplier (this parameter)""")
257 "-s", "--test", "--scenario", action="append", type = norm_path,
260 or just 'section.subsection' identifier. With '--testsuite-root' option
265 "--sub-test", action="append",
266 help="""Recursively find sub-test functions (test cases) and run the entire
268 functions. Sub-tests are named by:
274 the source files which are not generated by macro-substitutions.
275 Note: With --no-detailed-test-id use only Ztest names without scenario name.
279 "--pytest-args", action="append",
285 "--ctest-args", action="append",
291 "--enable-valgrind", action="store_true",
295 configuration and is mutual exclusive with --enable-asan.
299 "--enable-asan", action="store_true",
303 configuration and is mutual exclusive with --enable-valgrind.
306 # Start of individual args place them in alpha-beta order
317 "-A", "--board-root", action="append", default=board_root_list,
323 "--allow-installed-plugin", action="store_true", default=None,
328 "-a", "--arch", action="append",
329 help="Arch filter for testing. Takes precedence over --platform. "
334 "-B", "--subset",
341 "--shuffle-tests", action="store_true", default=None,
343 Used only when --subset is provided.""")
346 "--shuffle-tests-seed", action="store", default=None,
349 Used only when --shuffle-tests is provided.""")
352 "-c", "--clobber-output", action="store_true",
357 "--cmake-only", action="store_true",
360 coverage_group.add_argument("--enable-coverage", action="store_true",
363 coverage_group.add_argument("-C", "--coverage", action="store_true",
365 "--enable-coverage to collect the coverage data first.")
367 coverage_group.add_argument("--gcov-tool", type=Path, default=None,
371 " gcov installed on the host - for 'native' or 'unit' platform types,"
374 coverage_group.add_argument("--coverage-basedir", default=ZEPHYR_BASE,
377 coverage_group.add_argument("--coverage-platform", action="append", default=[],
380 "Default to what was selected with --platform.")
382 coverage_group.add_argument("--coverage-tool", choices=['lcov', 'gcovr'], default='gcovr',
383 help="Tool to use to generate coverage reports (%(default)s - default).")
385 coverage_group.add_argument("--coverage-formats", action="store", default=None,
387 "as a comma-separated list without spaces. " +
389 ','.join(supported_coverage_formats['gcovr']) + " (html - default)." +
391 ','.join(supported_coverage_formats['lcov']) + " (html,lcov - default).")
393 coverage_group.add_argument("--coverage-per-instance", action="store_true", default=False,
399 coverage_group.add_argument("--disable-coverage-aggregation",
403 active (`--coverage-per-instance`) to have at least one of these reporting
407 "--test-config",
413 parser.add_argument("--level", action="store",
418 "--device-serial-baud", action="store", default=None,
422 "--disable-suite-name-check", action="store_true", default=False,
427 parser.add_argument("-e", "--exclude-tag", action="append",
432 "--enable-lsan", action="store_true",
436 configuration and when --enable-asan is given.
440 "--enable-ubsan", action="store_true",
448 "--filter", choices=['buildable', 'runnable'],
449 default='runnable' if "--device-testing" in sys.argv else 'buildable',
455 parser.add_argument("--force-color", action="store_true",
459 parser.add_argument("--force-toolchain", action="store_true",
464 "--create-rom-ram-report",
467 "using additional build option `--target footprint`.")
470 "--footprint-report",
478 "Implies '--create-rom-ram-report' to generate the footprint data files. "
482 "--enable-size-report",
487 "--disable-unrecognized-section-test",
493 "--footprint-from-buildlog",
497 "Requires --enable-size-report or one of the baseline comparison modes."
503 "-m", "--last-metrics",
507 "Implies --enable-size-report option.")
510 "--compare-report",
513 "Implies --enable-size-report option.")
516 "--show-footprint",
521 "-H", "--footprint-threshold",
531 "-D", "--all-deltas",
535 "Implies --footprint-threshold=0")
538 "-z", "--size",
545 "-i", "--inline-logs", action="store_true",
549 parser.add_argument("--ignore-platform-key", action="store_true",
553 "-j", "--jobs", type=int,
555 "overcommitted by factor 2 when --build-only.")
558 "-K", "--force-platform", action="store_true",
564 "-l", "--all", action="store_true",
565 help="Build/test on all platforms. Any --platform arguments "
568 test_plan_report_xor.add_argument("--list-tags", action="store_true",
571 parser.add_argument("--log-file", metavar="FILENAME", action="store",
575 "-M", "--runtime-artifact-cleanup", choices=['pass', 'all'],
582 "--keep-artifacts", action="append", default=[],
587 "-N", "--ninja", action="store_true",
588 default=not any(a in sys.argv for a in ("-k", "--make")),
592 "-k", "--make", action="store_true",
596 "-n", "--no-clean", action="store_true",
597 help="Re-use the outdir before building. Will result in "
601 "--aggressive-no-clean", action="store_true",
602 help="Re-use the outdir before building and do not re-run cmake. Will result in "
610 '--detailed-test-id', action='store_true',
619 "--no-detailed-test-id", dest='detailed_test_id', action="store_false",
631 "--detailed-skipped-report", action="store_true",
637 "-O", "--outdir",
638 default=os.path.join(os.getcwd(), "twister-out"),
640 "Default is 'twister-out' in the current directory. "
641 "This directory will be cleaned unless '--no-clean' is set. "
642 "The '--clobber-output' option controls what cleaning does.")
645 "-o", "--report-dir",
652 parser.add_argument("--overflow-as-errors", action="store_true",
655 parser.add_argument("--report-filtered", action="store_true",
658 parser.add_argument("-P", "--exclude-platform", action="append", default=[],
664 parser.add_argument("--persistent-hardware-map", action='store_true',
665 help="""With --generate-hardware-map, tries to use
671 "--vendor", action="append", default=[],
675 "-p", "--platform", action="append", default=[],
683 "--platform-reports", action="store_true",
687 parser.add_argument("--pre-script",
693 "--quarantine-list",
702 "--quarantine-verify",
708 "--quit-on-failure",
714 "--report-name",
719 "--report-summary", action="store", nargs='?', type=int, const=0,
721 "However, you can specify the number of items (e.g. --report-summary 15). "
722 "It also works well with the --outdir switch.")
725 "--report-suffix",
731 "--report-all-options", action="store_true",
733 environment.options object in twister.json. Default: show only non-default settings.
737 "--retry-failed", type=int, default=0,
741 "--retry-interval", type=int, default=60,
745 "--retry-build-errors", action="store_true",
749 "-S", "--enable-slow", action="store_true",
750 default="--enable-slow-only" in sys.argv,
751 help="Execute time-consuming test cases that have been marked "
755 "--enable-slow-only", action="store_true",
756 help="Execute time-consuming test cases that have been marked "
757 "as 'slow' in testcase.yaml only. This also set the option --enable-slow")
760 "--seed", type=int,
761 help="Seed for native_sim pseudo-random number generator")
764 "--short-build-path",
771 "'--ninja' argument (to use Ninja build generator).")
774 "-t", "--tag", action="append",
779 parser.add_argument("--timestamps",
784 "-u",
785 "--no-update",
789 "twister, for example when re-running failed tests with --only-failed "
790 "or --no-clean. This option is for debugging purposes only.")
793 "-v",
794 "--verbose",
800 "-ll",
801 "--log-level",
808 parser.add_argument("-W", "--disable-warnings-as-errors", action="store_true",
812 "--west-flash", nargs='?', const=[],
814 --device-testing. Supports comma-separated argument list.
816 E.g "twister --device-testing --device-serial /dev/ttyACM0
817 --west-flash="--board-id=foobar,--erase"
818 will translate to "west flash -- --board-id=foobar --erase"
820 NOTE: device-testing must be enabled to use this option.
824 "--west-runner",
826 with --west-flash.
828 E.g "twister --device-testing --device-serial /dev/ttyACM0
829 --west-flash --west-runner=pyocd"
830 will translate to "west flash --runner pyocd"
832 NOTE: west-flash must be enabled to use this option.
837 "-X", "--fixture", action="append", default=[],
841 "-x", "--extra-args", action="append", default=[],
843 May be called multiple times. The key-value entries will be
844 prefixed with -D before being passed to CMake.
846 "twister -x=USE_CCACHE=0"
848 "cmake -DUSE_CCACHE=0"
854 "-y", "--dry-run", action="store_true",
862 help="Additional args following a '--' are passed to the test binary")
864 parser.add_argument("--alt-config-root", action="append", default=[],
879 ) -> argparse.Namespace:
885 logger.error("--short-build-path requires Ninja to be enabled")
889 logger.error("--device-serial-pty is not supported on Windows OS")
893 logger.error("west-runner requires west-flash to be enabled")
897 logger.error("west-flash requires device-testing to be enabled")
941 "either aggregation, or per-instance, or both.")
960 "Use --device-testing with --device-serial, or --device-serial-pty, or --hardware-map."
968 logger.error("When --device-testing is used with --device-serial "
969 "or --device-serial-pty, exactly one platform must "
974 logger.error("--device-flash-with-test requires --device_testing")
978 logger.error("--device-flash-with-test does not apply when --flash-before is used")
982 logger.error("--device-serial-pty cannot be used when --flash-before is set (for now)")
986 logger.error("--shuffle-tests requires --subset")
990 logger.error("--shuffle-tests-seed requires --shuffle-tests")
1001 logger.warning("WARNING: Using --footprint-from-buildlog will give inconsistent results "
1005 logger.error("--footprint-from-buildlog requires --enable-size-report")
1011 # list should begin with a "--". If not, there is some extra
1014 if options.extra_test_args[0] != "--":
1016 double_dash = options.extra_test_args.index("--")
1023 " Use -- to delineate extra arguments for test binary or pass -h for help."
1028 # Strip off the initial "--" following validation.
1032 logger.error("By default Twister should work without pytest-twister-harness "
1034 "`pip uninstall pytest-twister-harness` and `git clean "
1035 "-dxf scripts/pylib/pytest-twister-harness`.")
1039 "pytest-twister-harness plugin.")
1043 def strip_ansi_sequences(s: str) -> str:
1045 return re.sub(r'\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])', "", s)
1049 def __init__(self, options : argparse.Namespace, default_options=None) -> None:
1102 def non_default_options(self) -> dict:
1103 """Returns current command line options which are set to non-default values."""
1121 subproc = subprocess.run(["git", "describe", "--abbrev=12", "--always"],
1137 subproc = subprocess.run(["git", "show", "-s", "--format=%cI", "HEAD"],
1154 cmake_args = ["-D{}".format(a.replace('"', '')) for a in args[1:]]
1155 cmake_args.extend(['-P', script])
1191 toolchain_script = Path(ZEPHYR_BASE) / Path('cmake/verify-toolchain.cmake')