Skip to content

Commit

Permalink
kbuild: kselftest - new make target to build and run kernel selftests
Browse files Browse the repository at this point in the history
Add a new make target "kselftest" to enable kernel testing. This
new target builds and runs kernel selftests. Running as root is
recommended for a complete test run as some tests don't run when
run by non-root user. Build, install, and boot kernel before
running kselftest on it.

Signed-off-by: Shuah Khan <[email protected]>
Acked-by: Sam Ravnborg <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
  • Loading branch information
Shuah Khan authored and michal42 committed Aug 7, 2014
1 parent 5be1df6 commit 5a5da78
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1027,6 +1027,13 @@ headers_check: headers_install
$(Q)$(MAKE) $(hdr-inst)=include/uapi HDRCHECK=1
$(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/uapi/asm $(hdr-dst) HDRCHECK=1

# ---------------------------------------------------------------------------
# Kernel selftest

PHONY += kselftest
kselftest:
$(Q)$(MAKE) -C tools/testing/selftests run_tests

# ---------------------------------------------------------------------------
# Modules

Expand Down Expand Up @@ -1230,6 +1237,11 @@ help:
@echo ' headerdep - Detect inclusion cycles in headers'
@$(MAKE) -f $(srctree)/scripts/Makefile.help checker-help
@echo ''
@echo 'Kernel selftest'
@echo ' kselftest - Build and run kernel selftest (run as root)'
@echo ' Build, install, and boot kernel before'
@echo ' running kselftest on it'
@echo ''
@echo 'Kernel packaging:'
@$(MAKE) $(build)=$(package-dir) help
@echo ''
Expand Down

0 comments on commit 5a5da78

Please sign in to comment.