v2:
- update documentation
- include SPDX line in extracted script
v1: https://lore.kernel.org/linux-kselftest/20200925234527.1885234-1-keescook@c…
Hi!
I really like Hangbin Liu's intent[1] but I think we need to be a little
more clean about the implementation. This extracts run_kselftest.sh from
the Makefile so it can actually be changed without embeds, etc. Instead,
generate the test list into a text file. Everything gets much simpler.
:)
And in patch 2, I add back Hangbin Liu's new options (with some extra
added) with knowledge of "collections" (i.e. Makefile TARGETS) and
subtests. This should work really well with LAVA too, which needs to
manipulate the lists of tests being run.
Thoughts?
-Kees
[1] https://lore.kernel.org/lkml/20200914022227.437143-1-liuhangbin@gmail.com/
Kees Cook (3):
selftests: Extract run_kselftest.sh and generate stand-alone test list
selftests/run_kselftest.sh: Make each test individually selectable
doc: dev-tools: kselftest.rst: Update examples and paths
Documentation/dev-tools/kselftest.rst | 35 +++++----
tools/testing/selftests/Makefile | 26 ++-----
tools/testing/selftests/lib.mk | 5 +-
tools/testing/selftests/run_kselftest.sh | 93 ++++++++++++++++++++++++
4 files changed, 124 insertions(+), 35 deletions(-)
create mode 100755 tools/testing/selftests/run_kselftest.sh
--
2.25.1
Test in lib/ either KUnit or not are named in the same pattern,
i.e. test_*.c, except few ones. Rename list-test.c to test_list.c
to follow this pattern.
Note, current documentation doesn't specify any file name conventions,
and we glad to stick with a current one in the subsystem.
Signed-off-by: Andy Shevchenko <andriy.shevchenko(a)linux.intel.com>
---
lib/Makefile | 4 ++--
lib/{list-test.c => test_list.c} | 0
2 files changed, 2 insertions(+), 2 deletions(-)
rename lib/{list-test.c => test_list.c} (100%)
diff --git a/lib/Makefile b/lib/Makefile
index 5ca03ba6ee45..e71abeea4a3e 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -350,6 +350,6 @@ obj-$(CONFIG_PLDMFW) += pldmfw/
# KUnit tests
obj-$(CONFIG_BITFIELD_KUNIT) += bitfield_kunit.o
-obj-$(CONFIG_LIST_KUNIT_TEST) += list-test.o
-obj-$(CONFIG_LINEAR_RANGES_TEST) += test_linear_ranges.o
obj-$(CONFIG_BITS_TEST) += test_bits.o
+obj-$(CONFIG_LINEAR_RANGES_TEST) += test_linear_ranges.o
+obj-$(CONFIG_LIST_KUNIT_TEST) += test_list.o
diff --git a/lib/list-test.c b/lib/test_list.c
similarity index 100%
rename from lib/list-test.c
rename to lib/test_list.c
--
2.28.0
Hi Linus,
Please pull the following Kselftest fixes update for Linux 5.10-rc1.
This kselftest fixes update consists of a selftests harness fix to
flush stdout before forking to avoid parent and child printing
duplicates messages. This is evident when test output is redirected
to a file.
The second fix is a tools/ wide change to avoid comma separated
statements from Joe Perches. This fix spans tools/lib,
tools/power/cpupower, and selftests.
diff is attached
Please note that there is a conflict in
tools/testing/selftests/vm/gup_test.c
between commit:
aa803771a80a ("tools: Avoid comma separated statements")
from the kselftest-fixes tree and commit:
5c64830675a6 ("mm/gup_benchmark: rename to mm/gup_test")
from the akpm tree.
tools/testing/selftests/vm/gup_benchmark.c has been renamed
in 5c64830675a6 from akpm tree.
Stephen fixed this up in linux-next.
thanks,
-- Shuah
----------------------------------------------------------------
The following changes since commit 5c1e4f7e9e49b6925b1fb5c507d2c614f3edb292:
selftests/timers: Turn off timeout setting (2020-08-20 15:49:28 -0600)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest
tags/linux-kselftest-fixes-5.10-rc1
for you to fetch changes up to aa803771a80aa2aa2d5cdd38434b369066fbb8fc:
tools: Avoid comma separated statements (2020-10-02 10:36:36 -0600)
----------------------------------------------------------------
linux-kselftest-fixes-5.10-rc1
This kselftest fixes update consists of a selftests harness fix to
flush stdout before forking to avoid parent and child printing
duplicates messages. This is evident when test output is redirected
to a file.
The second fix is a tools/ wide change to avoid comma separated statements
from Joe Perches. This fix spans tools/lib, tools/power/cpupower, and
selftests.
----------------------------------------------------------------
Joe Perches (1):
tools: Avoid comma separated statements
Michael Ellerman (1):
selftests/harness: Flush stdout before forking
tools/lib/subcmd/help.c | 10 +-
tools/power/cpupower/utils/cpufreq-set.c | 14 +-
tools/testing/selftests/kselftest_harness.h | 5 +
tools/testing/selftests/vm/gup_benchmark.c | 18 +-
tools/testing/selftests/vm/userfaultfd.c | 296
+++++++++++++++++-----------
5 files changed, 215 insertions(+), 128 deletions(-)
----------------------------------------------------------------