Skip to content

selftests: Move test output to diagnostic lines

Kees Cook linux-kselftest lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest8 patches 8 repliesIn review

Changes in v2 from the cover letter

- fix external make variable "summary=1" through-out series (shuah)
- fix plan line output for all kselftest.h users

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8selftests: Extract single-test shell logic from lib.mktools/testing/selftests/.gitignore tools/testing/selftests/kselftest/runner.sh tools/testing/selftests/lib.mk+39 -310 replies
2/8selftests: Use runner.sh for emit targetstools/testing/selftests/Makefile tools/testing/selftests/lib.mk+7 -190 replies
3/8selftests: Extract logic for multiple test runstools/testing/selftests/Makefile tools/testing/selftests/kselftest/runner.sh tools/testing/selftests/lib.mk+32 -240 replies
4/8selftests: Add plan line and fix result line syntaxtools/testing/selftests/kselftest.h tools/testing/selftests/kselftest/runner.sh+8 -60 replies
5/8selftests: Distinguish between missing and non-executabletools/testing/selftests/kselftest/runner.sh+6 -10 replies
6/8selftests: Move test output to diagnostic linestools/testing/selftests/Makefile tools/testing/selftests/kselftest.h tools/testing/selftests/kselftest/prefix.pl +2 more+60 -60 replies
7/8selftests: Remove KSFT_TAP_LEVELtools/testing/selftests/Makefile tools/testing/selftests/kselftest/runner.sh+0 -73 replies
8/8selftests: Add test plan API to kselftest.h and adjust callerstools/testing/selftests/breakpoints/breakpoint_test.c tools/testing/selftests/breakpoints/breakpoint_test_arm64.c tools/testing/selftests/breakpoints/step_after_suspend_test.c +13 more+48 -80 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/8] selftests: Move test output to diagnostic lines

This refactors the selftest Makefiles to extract the test running logic to be reused between "run_tests" and "emit_tests", while also fixing up the test output to be TAP version 13 compliant:
- added "plan" line
- fixed result line syntax
- moved all test output to be "# "-prefixed as TAP "diagnostic" lines

The prefixing code includes a fallback mode for limited execution environments.

Additionally, the plan lines are fixed for all callers of kselftest.h.

-Kees

v2:
- fix external make variable "summary=1" through-out series (shuah)
- fix plan line output for all kselftest.h users

Kees Cook (8):
selftests: Extract single-test shell logic from lib.mk
selftests: Use runner.sh for emit targets
selftests: Extract logic for multiple test runs
selftests: Add plan line and fix result line syntax
selftests: Distinguish between missing and non-executable
selftests: Move test output to diagnostic lines
selftests: Remove KSFT_TAP_LEVEL
selftests: Add test plan API to kselftest.h and adjust callers

 tools/testing/selftests/.gitignore            |  1 -
 tools/testing/selftests/Makefile              | 24 ++----
 .../selftests/breakpoints/breakpoint_test.c   | 15 +++-
 .../breakpoints/breakpoint_test_arm64.c       |  3 +-
 .../breakpoints/step_after_suspend_test.c     |  8 ++
 .../selftests/capabilities/test_execve.c      |  6 +-
 .../futex/functional/futex_requeue_pi.c       |  1 +
 .../futex_requeue_pi_mismatched_ops.c         |  1 +
 .../futex_requeue_pi_signal_restart.c         |  1 +
 .../futex_wait_private_mapped_file.c          |  1 +
 .../futex/functional/futex_wait_timeout.c     |  1 +
 .../futex_wait_uninitialized_heap.c           |  1 +
 .../futex/functional/futex_wait_wouldblock.c  |  1 +
 tools/testing/selftests/kselftest.h           | 17 +++-
 tools/testing/selftests/kselftest/prefix.pl   | 23 +++++
 tools/testing/selftests/kselftest/runner.sh   | 86 +++++++++++++++++++
 tools/testing/selftests/lib.mk                | 64 +++-----------
 .../selftests/membarrier/membarrier_test.c    |  1 +
 tools/testing/selftests/pidfd/pidfd_test.c    |  1 +
 tools/testing/selftests/sigaltstack/sas.c     |  1 +
 tools/testing/selftests/sync/sync_test.c      |  1 +
 21 files changed, 178 insertions(+), 80 deletions(-)
 create mode 100755 tools/testing/selftests/kselftest/prefix.pl
 create mode 100644 tools/testing/selftests/kselftest/runner.sh
Signature · 1 line
2.17.1