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

2 # SPDX-License-Identifier: GPL-2.0
13 import time
50 def get_kernel_root_path() -> str:
58 request: KunitConfigRequest) -> KunitResult:
61 config_start = time.time()
63 config_end = time.time()
67 config_end - config_start)
70 config_end - config_start)
73 request: KunitBuildRequest) -> KunitResult:
76 build_start = time.time()
81 build_end = time.time()
85 build_end - build_start)
89 build_end - build_start)
92 build_end - build_start)
95 request: KunitExecRequest) -> KunitResult:
97 test_start = time.time()
104 test_end = time.time()
108 test_end - test_start)
110 def parse_tests(request: KunitParseRequest) -> KunitResult:
111 parse_start = time.time()
124 print(f'Unknown --raw_output option "{request.raw_output}"', file=sys.stderr)
130 parse_end = time.time()
143 parse_end - parse_start)
146 parse_end - parse_start)
149 request: KunitRequest) -> KunitResult:
150 run_start = time.time()
178 run_end = time.time()
181 'Elapsed time: %.3fs total, %.3fs configuring, %.3fs ' +
183 run_end - run_start,
190 # $ kunit.py run --json
192 # $ kunit.py run --json suite_name
195 # $ kunit.py run --json=suite_name
196 # i.e. it would run all tests, and dump the json to a `suite_name` file.
197 # So we hackily automatically rewrite --json => --json=stdout
199 '--json': 'stdout',
200 '--raw_output': 'kunit',
202 def massage_argv(argv: Sequence[str]) -> Sequence[str]:
203 def massage_arg(arg: str) -> str:
209 def add_common_opts(parser) -> None:
210 parser.add_argument('--build_dir',
214 parser.add_argument('--make_options',
217 parser.add_argument('--alltests',
218 help='Run all KUnit tests through allyesconfig',
220 parser.add_argument('--kunitconfig',
226 parser.add_argument('--arch',
227 help=('Specifies the architecture to run tests under. '
230 'e.g. i386, x86_64, arm, um, etc. Non-UML '
231 'architectures run on QEMU.'),
234 parser.add_argument('--cross_compile',
238 'example `sparc64-linux-gnu-` if you have the '
240 '`$HOME/toolchains/microblaze/gcc-9.2.0-nolibc/microblaze-linux/bin/microblaze-linux-` '
242 'from the 0-day website to a directory in your '
246 parser.add_argument('--qemu_config',
251 def add_build_opts(parser) -> None:
252 parser.add_argument('--jobs',
254 'jobs (commands) to run simultaneously."',
257 def add_exec_opts(parser) -> None:
258 parser.add_argument('--timeout',
260 'to run. This does not include time taken to build the '
267 'to run. This does not include time taken to build the '
273 parser.add_argument('--kernel_args',
274 help='Kernel command-line parameters. Maybe be repeated',
277 def add_parse_opts(parser) -> None:
278 parser.add_argument('--raw_output', help='If set don\'t format output from kernel. '
279 'If set to --raw_output=kunit, filters to just KUnit output.',
281 parser.add_argument('--json',
293 # The 'run' command will config, build, exec, and parse in one go.
294 run_parser = subparser.add_parser('run', help='Runs KUnit tests.')
309 exec_parser = subparser.add_parser('exec', help='Run a kernel with KUnit tests')
316 # and the '--file' argument is not relevant to 'run', so isn't in
331 if cli_args.subcommand == 'run':
370 'Elapsed time: %.3fs\n') % (
388 'Elapsed time: %.3fs\n') % (
412 'Elapsed time: %.3fs\n') % (