diff --git a/docs/targets.md b/docs/targets.md index 0780a9b..b2f0e95 100644 --- a/docs/targets.md +++ b/docs/targets.md @@ -120,9 +120,13 @@ which is copied into the output directory as `headers.tar.xz`. ## kselftest -Build the kernsel selftests. The resulting, installed tests are compressed in a +Build the kernel selftests. The resulting, installed tests are compressed in a tarball which is copied into the output directory as `kselftest.tar.xz`. +This target depends on the `headers` target. The selftests build against the +UAPI headers in the build directory, so they must be installed first. This is +the same order the kernel uses for its own `make kselftest` target. + TuxMake doesn't do anything special with regards to which tests are built, so by default it will build everything that kselftest builds by default. If you want to build a subset of the tests, you can use the same mechanism that you diff --git a/test/test_build.py b/test/test_build.py index 5b49cf5..d89cbc3 100644 --- a/test/test_build.py +++ b/test/test_build.py @@ -1124,10 +1124,10 @@ def test_vmlinux(self, linux): class TestKselftest: - def test_kselftest_depends_on_config(self, linux): + def test_kselftest_depends_on_config_and_headers(self, linux): build = Build(tree=linux, targets=["kselftest"]) names = [t.name for t in build.targets] - assert names == ["config", "kselftest"] + assert names == ["config", "headers", "kselftest"] def test_nonfatal_continues_on_failure(self, linux, mocker): b = Build(tree=linux, targets=["config"]) diff --git a/tuxmake/target/kselftest.ini b/tuxmake/target/kselftest.ini index 237387b..5111fc6 100644 --- a/tuxmake/target/kselftest.ini +++ b/tuxmake/target/kselftest.ini @@ -1,6 +1,6 @@ [target] description = "Kernel selftest (kselftest)" -dependencies = config +dependencies = config headers nonfatal = true commands = {make} -C tools/testing/selftests all && {make} -i -C tools/testing/selftests install