Lines Matching +full:stdout +full:- +full:path

2 # SPDX-License-Identifier: GPL-2.0
26 from kunit_printer import stdout
66 def get_kernel_root_path() -> str:
67 path = sys.argv[0] if not __file__ else __file__
68 parts = os.path.realpath(path).split('tools/testing/kunit')
74 request: KunitConfigRequest) -> KunitResult:
75 stdout.print_with_timestamp('Configuring KUnit Kernel ...')
82 config_end - config_start)
84 config_end - config_start)
87 request: KunitBuildRequest) -> KunitResult:
88 stdout.print_with_timestamp('Building KUnit Kernel ...')
97 build_end - build_start)
100 build_end - build_start)
102 build_end - build_start)
105 request: KunitBuildRequest) -> KunitResult:
112 def _list_tests(linux: kunit_kernel.LinuxSourceTree, request: KunitExecRequest) -> List[str]:
125 # Filter out any extraneous non-test output that might have gotten mixed in.
128 def _suites_from_test_list(tests: List[str]) -> List[str]:
136 if not suites or suites[-1] != suite:
142 def exec_tests(linux: kunit_kernel.LinuxSourceTree, request: KunitExecRequest) -> KunitResult:
150 # Apply the test-part of the user's glob, if present.
160 stdout.print_with_timestamp('Starting KUnit Kernel ({}/{})...'.format(i+1, len(filter_globs)))
174 exec_time += test_end - test_start
187 def _map_to_overall_status(test_status: kunit_parser.TestStatus) -> KunitStatus:
192 …unitParseRequest, metadata: kunit_json.Metadata, input_data: Iterable[str]) -> Tuple[KunitResult, …
218 if request.json == 'stdout':
223 stdout.print_with_timestamp("Test results stored in %s" %
224 os.path.abspath(request.json))
227 return KunitResult(KunitStatus.TEST_FAILURE, parse_end - parse_start), test_result
229 return KunitResult(KunitStatus.SUCCESS, parse_end - parse_start), test_result
232 request: KunitRequest) -> KunitResult:
247 stdout.print_with_timestamp((
250 run_end - run_start,
257 # $ kunit.py run --json
259 # $ kunit.py run --json suite_name
262 # $ kunit.py run --json=suite_name
264 # So we hackily automatically rewrite --json => --json=stdout
266 '--json': 'stdout',
267 '--raw_output': 'kunit',
269 def massage_argv(argv: Sequence[str]) -> Sequence[str]:
270 def massage_arg(arg: str) -> str:
276 def get_default_jobs() -> int:
279 def add_common_opts(parser) -> None:
280 parser.add_argument('--build_dir',
284 parser.add_argument('--make_options',
287 parser.add_argument('--alltests',
290 parser.add_argument('--kunitconfig',
291 help='Path to Kconfig fragment that enables KUnit tests.'
296 parser.add_argument('--kconfig_add',
301 parser.add_argument('--arch',
305 'e.g. i386, x86_64, arm, um, etc. Non-UML '
309 parser.add_argument('--cross_compile',
311 'be set to a toolchain path prefix (the prefix '
313 'example `sparc64-linux-gnu-` if you have the '
315 '`$HOME/toolchains/microblaze/gcc-9.2.0-nolibc/microblaze-linux/bin/microblaze-linux-` '
317 'from the 0-day website to a directory in your '
321 parser.add_argument('--qemu_config',
322 help=('Takes a path to a path to a file containing '
326 parser.add_argument('--qemu_args',
327 help='Additional QEMU arguments, e.g. "-smp 8"',
330 def add_build_opts(parser) -> None:
331 parser.add_argument('--jobs',
336 def add_exec_opts(parser) -> None:
337 parser.add_argument('--timeout',
346 'boot-time, e.g. list* or list*.*del_test',
351 parser.add_argument('--kernel_args',
352 help='Kernel command-line parameters. Maybe be repeated',
354 parser.add_argument('--run_isolated', help='If set, boot the kernel for each '
356 'a non-hermetic test, one that might pass/fail based on '
361 def add_parse_opts(parser) -> None:
362 parser.add_argument('--raw_output', help='If set don\'t format output from kernel. '
363 'If set to --raw_output=kunit, filters to just KUnit output.',
365 parser.add_argument('--json',
368 'prints to stdout or saves to file if a '
370 type=str, const='stdout', default=None, metavar='FILE')
373 def tree_from_args(cli_args: argparse.Namespace) -> kunit_kernel.LinuxSourceTree:
375 # Allow users to specify multiple arguments in one string, e.g. '-smp 8'
383 # Prepend so user-specified options take prio if we ever allow
384 # --kunitconfig options to have differing options.
424 # and the '--file' argument is not relevant to 'run', so isn't in
440 if not os.path.exists(cli_args.build_dir):
458 not os.path.exists(cli_args.build_dir)):
465 stdout.print_with_timestamp((
476 stdout.print_with_timestamp((
491 stdout.print_with_timestamp((
497 sys.stdin.reconfigure(errors='backslashreplace') # pytype: disable=attribute-error