path: root/tools/testing/selftests/powerpc/pmu
diff options
authorMichael Ellerman <mpe@ellerman.id.au>2015-03-11 15:06:01 +1100
committerShuah Khan <shuahkh@osg.samsung.com>2015-03-19 12:38:51 -0600
commit6faeeea44b84ce24fc6c1f1beb07ee5de9885dc8 (patch)
treeee9e473870eea00b5672564825bfab7e374fed3b /tools/testing/selftests/powerpc/pmu
parentselftests/timers: Use shared logic to run and install tests (diff)
selftests: Add install support for the powerpc tests
The bulk of the selftests are actually below the powerpc sub directory. This adds support for installing them, when on a powerpc machine, or if ARCH and CROSS_COMPILE are set appropriately. This is a little more complicated because of the sub directory structure under powerpc, but much of the common logic in lib.mk is still used. The net effect of the patch is still a reduction in code. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Diffstat (limited to 'tools/testing/selftests/powerpc/pmu')
2 files changed, 31 insertions, 30 deletions
diff --git a/tools/testing/selftests/powerpc/pmu/Makefile b/tools/testing/selftests/powerpc/pmu/Makefile
index c9f4263906a5..5a161175bbd4 100644
--- a/tools/testing/selftests/powerpc/pmu/Makefile
+++ b/tools/testing/selftests/powerpc/pmu/Makefile
@@ -1,38 +1,42 @@
$(MAKE) -C ../
-PROGS := count_instructions l3_bank_test per_event_excludes
+TEST_PROGS := count_instructions l3_bank_test per_event_excludes
EXTRA_SOURCES := ../harness.c event.c lib.c
+all: $(TEST_PROGS) ebb
# loop.S can only be built 64-bit
count_instructions: loop.S count_instructions.c $(EXTRA_SOURCES)
$(CC) $(CFLAGS) -m64 -o $@ $^
-run_tests: all sub_run_tests
- @-for PROG in $(PROGS); do \
- ./$$PROG; \
- done;
+include ../../lib.mk
-clean: sub_clean
- rm -f $(PROGS) loop.o
+override define RUN_TESTS
+ $(MAKE) -C ebb run_tests
- $(MAKE) -k -C $@ all
+override define EMIT_TESTS
+ $(MAKE) -s -C ebb emit_tests
-sub_run_tests: all
- @for TARGET in $(SUB_TARGETS); do \
- $(MAKE) -C $$TARGET run_tests; \
- done;
+override define INSTALL_RULE
+ $(MAKE) -C ebb install
- @for TARGET in $(SUB_TARGETS); do \
- $(MAKE) -C $$TARGET clean; \
- done;
+ rm -f $(TEST_PROGS) loop.o
+ $(MAKE) -C ebb clean
+ $(MAKE) -k -C $@ all
-.PHONY: all run_tests clean sub_run_tests sub_clean $(SUB_TARGETS)
+.PHONY: all run_tests clean ebb
diff --git a/tools/testing/selftests/powerpc/pmu/ebb/Makefile b/tools/testing/selftests/powerpc/pmu/ebb/Makefile
index 3dc4332698cb..5cdc9dbf2b27 100644
--- a/tools/testing/selftests/powerpc/pmu/ebb/Makefile
+++ b/tools/testing/selftests/powerpc/pmu/ebb/Makefile
@@ -4,7 +4,7 @@ noarg:
# The EBB handler is 64-bit code and everything links against it
CFLAGS += -m64
-PROGS := reg_access_test event_attributes_test cycles_test \
+TEST_PROGS := reg_access_test event_attributes_test cycles_test \
cycles_with_freeze_test pmc56_overflow_test \
ebb_vs_cpu_event_test cpu_event_vs_ebb_test \
cpu_event_pinned_vs_ebb_test task_event_vs_ebb_test \
@@ -16,18 +16,15 @@ PROGS := reg_access_test event_attributes_test cycles_test \
lost_exception_test no_handler_test \
-all: $(PROGS)
+all: $(TEST_PROGS)
-$(PROGS): ../../harness.c ../event.c ../lib.c ebb.c ebb_handler.S trace.c busy_loop.S
+$(TEST_PROGS): ../../harness.c ../event.c ../lib.c ebb.c ebb_handler.S trace.c busy_loop.S
instruction_count_test: ../loop.S
lost_exception_test: ../lib.c
-run_tests: all
- @-for PROG in $(PROGS); do \
- ./$$PROG; \
- done;
+include ../../../lib.mk
- rm -f $(PROGS)
+ rm -f $(TEST_PROGS)