UBUNTU: [Packaging] add support to compile/run selftests

BugLink: https://bugs.launchpad.net/bugs/1874286

Add some simple debian/rules targets that will keep a list of the
selftests that Ubuntu cares about, compile and run them. This can be
plugged into our test build infrastructure in order to compile the
testcases before we close and package a release.
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
Acked-by: default avatarStefan Bader <stefan.bader@canonical.com>
Acked-by: default avatarBenjamin M Romer <benjamin.romer@canonical.com>
Signed-off-by: default avatarKelsey Skunberg <kelsey.skunberg@canonical.com>
parent 44c85dbb
......@@ -253,3 +253,6 @@ LN = ln -sf
# flavour as arguments.
custom_override = \
$(shell if [ -n "$($(1)_$(2))" ]; then echo "$($(1)_$(2))"; else echo "$($(1))"; fi)
# selftests that Ubuntu cares about
ubuntu_selftests = breakpoints cpu-hotplug efivarfs memory-hotplug mount net ptrace powerpc seccomp user
......@@ -26,6 +26,10 @@ help:
@echo
@echo " diffupstream : Diff stock kernel code against upstream (git)"
@echo
@echo " compileselftests : Only compile the selftests listed on ubuntu_selftests variable"
@echo
@echo " runselftests : Run the selftests listed on ubuntu_selftests variable"
@echo
@echo " help : If you are kernel hacking, you need the professional"
@echo " version of this"
@echo
......@@ -67,6 +71,7 @@ printenv:
@echo "skipdbg = $(skipdbg)"
@echo "ubuntu_log_opts = $(ubuntu_log_opts)"
@echo "CONCURRENCY_LEVEL = $(CONCURRENCY_LEVEL)"
@echo "ubuntu_selftests = $(ubuntu_selftests)"
@echo "bin package name = $(bin_pkg_name)"
@echo "hdr package name = $(hdrs_pkg_name)"
@echo "doc package name = $(doc_pkg_name)"
......@@ -151,3 +156,11 @@ startnewrelease:
cat $(DEBIAN)/changelog >> $(DEBIAN)/changelog.new; \
mv $(DEBIAN)/changelog.new $(DEBIAN)/changelog
compileselftests:
# a loop is needed here to fail on errors
for test in $(ubuntu_selftests); do \
$(kmake) -C tools/testing/selftests TARGETS="$$test"; \
done;
runselftests:
$(kmake) -C tools/testing/selftests TARGETS="$(ubuntu_selftests)" run_tests
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment