Skip to contentSkip to conversation

selftests: add 'show_targets' make target

PATCH In review [email protected] 3 participants 3 messages Mar 13, 2020 – Apr 8, 2020 Kselftest

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selftests: add 'show_targets' make target

From: Tim Bird <[email protected]>

It is useful for CI systems to be able to query the list of targets provided by kselftest by default, so that they can construct their own loop over the targets if desired.

---
 tools/testing/selftests/Makefile | 3 +++
 1 file changed, 3 insertions(+)
tools/testing/selftests/Makefile +3 -0
index 63430e2..9955e71 100644
@@ -246,4 +246,7 @@ clean:
 		$(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET clean;\
 	done;
 
+show_targets:
+	@echo $(TARGETS)
+
 .PHONY: khdr all run_tests hotplug run_hotplug clean_hotplug run_pstore_crash install clean
Signature · 1 line
2.1.4
maintainer
#1 lore raw
Quoted 17 lines · On 3/13/20 4:23 PM, [email protected] wrote:

From: Tim Bird <[email protected]>

It is useful for CI systems to be able to query the list of targets provided by kselftest by default, so that they can construct their own loop over the targets if desired.

---
  tools/testing/selftests/Makefile | 3 +++
  1 file changed, 3 insertions(+)
tools/testing/selftests/Makefile +0 -0
index 63430e2..9955e71 100644

tools/testing/selftests/Makefile clean: · line 252

Quoted 7 lines
tools/testing/selftests/Makefile +3 -0
@@ -246,4 +246,7 @@ clean:
  		$(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET clean;\
  	done;
 
+show_targets:
+	@echo $(TARGETS)
+
  .PHONY: khdr all run_tests hotplug run_hotplug clean_hotplug run_pstore_crash install clean

Hi Tim,

It is useful addition. Output is hard to read though. It would be helpful to improve the printing targets.

make -C tools/testing/selftests/ show_targets
make: Entering directory '/lkml/linux_5.7/tools/testing/selftests'
android arm64 bpf breakpoints capabilities cgroup clone3 cpufreq cpu-hotplug drivers/dma-buf efivarfs exec filesystems filesystems/binderfs filesystems/epoll firmware ftrace futex gpio intel_pstate ipc ir kcmp kexec kvm lib livepatch lkdtm membarrier memfd memory-hotplug mount mqueue net net/forwarding net/mptcp netfilter nsfs pidfd pid_namespace powerpc proc pstore ptrace openat2 rseq rtc seccomp sigaltstack size sparc64 splice static_keys sync sysctl timens timers tmpfs tpm2 user vm x86 zram

thanks,
-- Shuah

#2 lore raw
Quoted 47 lines

-----Original Message-----
From: shuah <[email protected]>

Quoted 17 lines · On 3/13/20 4:23 PM, [email protected] wrote:

From: Tim Bird <[email protected]>

It is useful for CI systems to be able to query the list of targets provided by kselftest by default, so that they can construct their own loop over the targets if desired.

---
  tools/testing/selftests/Makefile | 3 +++
  1 file changed, 3 insertions(+)
tools/testing/selftests/Makefile +0 -0
index 63430e2..9955e71 100644

tools/testing/selftests/Makefile clean: · line 252

Quoted 7 lines
tools/testing/selftests/Makefile +3 -0
@@ -246,4 +246,7 @@ clean:
  		$(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET clean;\
  	done;
 
+show_targets:
+	@echo $(TARGETS)
+
  .PHONY: khdr all run_tests hotplug run_hotplug clean_hotplug run_pstore_crash install clean

Hi Tim,

It is useful addition. Output is hard to read though. It would be helpful to improve the printing targets.

make -C tools/testing/selftests/ show_targets
make: Entering directory '/lkml/linux_5.7/tools/testing/selftests' android arm64 bpf breakpoints capabilities cgroup clone3 cpufreq cpu-hotplug drivers/dma-buf efivarfs exec filesystems filesystems/binderfs filesystems/epoll firmware ftrace futex gpio intel_pstate ipc ir kcmp kexec kvm lib livepatch lkdtm membarrier memfd memory-hotplug mount mqueue net net/forwarding net/mptcp netfilter nsfs pidfd pid_namespace powerpc proc pstore ptrace openat2 rseq rtc seccomp sigaltstack size sparc64 splice static_keys sync sysctl timens timers tmpfs tpm2 user vm x86 zram

Quoted 2 lines

thanks,
-- Shuah

OK. I did this mainly for test automation, so I was only concerned about machine readability. I have code that looks like this:

TARGET_LIST=$(make --no-print-directory -s -C tools/testing/selftests show_targets)

However, I'd agree that the output is not great for humans.

How would you like it improved? Would you like it shown as a single column? Or indented? Or using some organization besides alphabetical?

Let me know and I'll implement something.
-- Tim