linux/tools/testing/kunit
David Gow 29afed142d kunit:tool: Don't write to stdout when it should be disabled
The kunit_parser module accepts a 'printer' object which is used as a
destination for all output. This is typically set to stdout, so that the
parsed results are visible, but can be set to a special 'null_printer' to
implement options where not all results are always printed.

However, there are a few places where use of stdout is hardcoded, notably
in handling crashed tests and in outputting the colour escape sequences.

Properly use the specified printer for all output. This is okay for the
colour handling (as this is already gated behind isatty() anyway), and also
for the crash handling, as cases where printer != stdout are separately
printed afterwards.

Link: https://lore.kernel.org/r/20260606020317.264178-1-david@davidgow.net
Fixes: 062a9dd9ba ("kunit: tool: Only print the summary")
Signed-off-by: David Gow <david@davidgow.net>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2026-06-07 20:10:30 -06:00
..
configs CRC updates for 7.1 2026-04-13 17:36:04 -07:00
qemu_configs kunit: qemu_configs: Add or1k / openrisc configuration 2026-05-04 13:12:55 -06:00
test_data kunit: tool: Don't overwrite test status based on subtest counts 2026-01-05 15:36:08 -07:00
.gitignore .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
kunit_config.py kunit: tool: fix pre-existing mypy --strict errors and update run_checks.py 2023-03-17 12:28:30 -06:00
kunit_json.py kunit: tool: add test counts to JSON output 2025-05-19 13:22:28 -06:00
kunit_junit.py kunit: tool: Add (primitive) support for outputting JUnit XML 2026-06-07 19:50:16 -06:00
kunit_kernel.py kunit: Fix spelling mistakes in comments and messages 2026-05-04 13:12:55 -06:00
kunit_parser.py kunit:tool: Don't write to stdout when it should be disabled 2026-06-07 20:10:30 -06:00
kunit_printer.py kunit: tool: Only print the summary 2024-11-19 14:52:17 -07:00
kunit_tool_test.py kunit: tool: Add (primitive) support for outputting JUnit XML 2026-06-07 19:50:16 -06:00
kunit-completion.sh kunit: add bash completion 2026-01-20 11:17:52 -07:00
kunit.py kunit: tool: Add (primitive) support for outputting JUnit XML 2026-06-07 19:50:16 -06:00
mypy.ini kunit: tool: undo type subscripts for subprocess.Popen 2023-05-08 08:39:41 -06:00
qemu_config.py kunit: tool: Add support for overriding the QEMU serial port 2023-04-05 12:51:06 -06:00
run_checks.py kunit: tool: undo type subscripts for subprocess.Popen 2023-05-08 08:39:41 -06:00