diff mbox

[v2] kbuild: kselftest - new make target to build and run kernel selftests

Message ID 1407420192-4928-1-git-send-email-shuah.kh@samsung.com (mailing list archive)
State New, archived
Headers show

Commit Message

Shuah Khan Aug. 7, 2014, 2:03 p.m. UTC
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.

Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
---
 Makefile | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Sam Ravnborg Aug. 7, 2014, 3:57 p.m. UTC | #1
On Thu, Aug 07, 2014 at 08:03:12AM -0600, Shuah Khan wrote:
> 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.

kselftest will run the test - but will not build the kerenl.
That is does not build the kernel is IMO a good thing -
as one may re-run the test while doing work on the kernel, and triggering
a rebuild to re-run the test is not nice.

The changelog + help text needs to be updated to reflect that the kernel is not
built when you use "make kselftest".

On top of this - can you please tell what plans exists to extend this.
When we discussed "devtest" it was said that it would not be a wrapper
for selftests run_tests only, but more was planned to be added.


	Sam
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Shuah Khan Aug. 7, 2014, 4:13 p.m. UTC | #2
On 08/07/2014 09:57 AM, Sam Ravnborg wrote:
> On Thu, Aug 07, 2014 at 08:03:12AM -0600, Shuah Khan wrote:
>> 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.
>
> kselftest will run the test - but will not build the kerenl.
> That is does not build the kernel is IMO a good thing -
> as one may re-run the test while doing work on the kernel, and triggering
> a rebuild to re-run the test is not nice.

Good. That is the reason why I made the change to not run make all.
Result of an aha moment when I was working on the v2 :)

>
> The changelog + help text needs to be updated to reflect that the kernel is not
> built when you use "make kselftest".

I will update the changelog and re-send the patch.

>
> On top of this - can you please tell what plans exists to extend this.
> When we discussed "devtest" it was said that it would not be a wrapper
> for selftests run_tests only, but more was planned to be added.
>

I posted agenda item to ksummit-discuss this morning outlining the
progress made in 3.17 and what's planned for 3.18 and beyond. I think
the post is waiting for moderator approval.

-- Shuah
diff mbox

Patch

diff --git a/Makefile b/Makefile
index d0901b4..7eda9fb 100644
--- a/Makefile
+++ b/Makefile
@@ -1036,6 +1036,13 @@  headers_check: headers_install
 	$(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
 
 ifdef CONFIG_MODULES
@@ -1238,6 +1245,9 @@  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  ''
 	@echo  'Kernel packaging:'
 	@$(MAKE) $(build)=$(package-dir) help
 	@echo  ''