Lines Matching +full:run +full:- +full:time

2 # SPDX-License-Identifier: GPL-2.0
15 import time
70 def get_kernel_root_path() -> str:
78 request: KunitConfigRequest) -> KunitResult:
81 config_start = time.time()
83 config_end = time.time()
85 return KunitResult(status, config_end - config_start)
88 request: KunitBuildRequest) -> KunitResult:
91 build_start = time.time()
95 build_end = time.time()
97 return KunitResult(status, build_end - build_start)
100 request: KunitBuildRequest) -> KunitResult:
107 def _list_tests(linux: kunit_kernel.LinuxSourceTree, request: KunitExecRequest) -> List[str]:
123 # Filter out any extraneous non-test output that might have gotten mixed in.
126 def _list_tests_attr(linux: kunit_kernel.LinuxSourceTree, request: KunitExecRequest) -> Iterable[st…
142 # Filter out any extraneous non-test output that might have gotten mixed in.
145 def _suites_from_test_list(tests: List[str]) -> List[str]:
153 if not suites or suites[-1] != suite:
157 def exec_tests(linux: kunit_kernel.LinuxSourceTree, request: KunitExecRequest) -> KunitResult:
175 # Apply the test-part of the user's glob, if present.
187 test_start = time.time()
199 # So exec_time here actually contains parsing + execution time, which is fine.
200 test_end = time.time()
201 exec_time += test_end - test_start
214 def _map_to_overall_status(test_status: kunit_parser.TestStatus) -> KunitStatus:
219 …unitParseRequest, metadata: kunit_json.Metadata, input_data: Iterable[str]) -> Tuple[KunitResult, …
220 parse_start = time.time()
235 parse_time = time.time() - parse_start
241 parse_time = time.time() - parse_start
261 request: KunitRequest) -> KunitResult:
262 run_start = time.time()
274 run_end = time.time()
277 'Elapsed time: %.3fs total, %.3fs configuring, %.3fs ' +
279 run_end - run_start,
286 # $ kunit.py run --json
288 # $ kunit.py run --json suite_name
291 # $ kunit.py run --json=suite_name
292 # i.e. it would run all tests, and dump the json to a `suite_name` file.
293 # So we hackily automatically rewrite --json => --json=stdout
295 '--json': 'stdout',
296 '--raw_output': 'kunit',
298 def massage_argv(argv: Sequence[str]) -> Sequence[str]:
299 def massage_arg(arg: str) -> str:
305 def get_default_jobs() -> int:
308 def add_common_opts(parser: argparse.ArgumentParser) -> None:
309 parser.add_argument('--build_dir',
313 parser.add_argument('--make_options',
316 parser.add_argument('--alltests',
317 help='Run all KUnit tests via tools/testing/kunit/configs/all_tests.config',
319 parser.add_argument('--kunitconfig',
325 parser.add_argument('--kconfig_add',
330 parser.add_argument('--arch',
331 help=('Specifies the architecture to run tests under. '
334 'e.g. i386, x86_64, arm, um, etc. Non-UML '
335 'architectures run on QEMU.'),
338 parser.add_argument('--cross_compile',
342 'example `sparc64-linux-gnu-` if you have the '
344 '`$HOME/toolchains/microblaze/gcc-9.2.0-nolibc/microblaze-linux/bin/microblaze-linux-` '
346 'from the 0-day website to a directory in your '
350 parser.add_argument('--qemu_config',
355 parser.add_argument('--qemu_args',
356 help='Additional QEMU arguments, e.g. "-smp 8"',
359 def add_build_opts(parser: argparse.ArgumentParser) -> None:
360 parser.add_argument('--jobs',
362 'jobs (commands) to run simultaneously."',
365 def add_exec_opts(parser: argparse.ArgumentParser) -> None:
366 parser.add_argument('--timeout',
368 'to run. This does not include time taken to build the '
374 help='Filter which KUnit test suites/tests run at '
375 'boot-time, e.g. list* or list*.*del_test',
380 parser.add_argument('--filter',
385 parser.add_argument('--filter_action',
387 'e.g. --filter_action=skip. Otherwise they will not run.',
390 parser.add_argument('--kernel_args',
391 help='Kernel command-line parameters. Maybe be repeated',
393 parser.add_argument('--run_isolated', help='If set, boot the kernel for each '
395 'a non-hermetic test, one that might pass/fail based on '
399 parser.add_argument('--list_tests', help='If set, list all tests that will be '
400 'run.',
402 parser.add_argument('--list_tests_attr', help='If set, list all tests and test '
406 def add_parse_opts(parser: argparse.ArgumentParser) -> None:
407 parser.add_argument('--raw_output', help='If set don\'t parse output from kernel. '
409 '--raw_output=all to show everything',
411 parser.add_argument('--json',
414 'a filename is specified. Does nothing if --raw_output is set.',
418 def tree_from_args(cli_args: argparse.Namespace) -> kunit_kernel.LinuxSourceTree:
420 # Allow users to specify multiple arguments in one string, e.g. '-smp 8'
428 # Prepend so user-specified options take prio if we ever allow
429 # --kunitconfig options to have differing options.
441 def run_handler(cli_args: argparse.Namespace) -> None:
464 def config_handler(cli_args: argparse.Namespace) -> None:
474 'Elapsed time: %.3fs\n') % (
480 def build_handler(cli_args: argparse.Namespace) -> None:
487 'Elapsed time: %.3fs\n') % (
493 def exec_handler(cli_args: argparse.Namespace) -> None:
508 'Elapsed time: %.3fs\n') % (result.elapsed_time))
513 def parse_handler(cli_args: argparse.Namespace) -> None:
530 'run': run_handler,
538 def main(argv: Sequence[str]) -> None:
543 # The 'run' command will config, build, exec, and parse in one go.
544 run_parser = subparser.add_parser('run', help='Runs KUnit tests.')
559 exec_parser = subparser.add_parser('exec', help='Run a kernel with KUnit tests')
566 # and the '--file' argument is not relevant to 'run', so isn't in