aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing
diff options
context:
space:
mode:
authorMichael Ellerman <mpe@ellerman.id.au>2015-03-11 00:06:01 -0400
committerShuah Khan <shuahkh@osg.samsung.com>2015-03-19 14:38:51 -0400
commit6faeeea44b84ce24fc6c1f1beb07ee5de9885dc8 (patch)
treeee9e473870eea00b5672564825bfab7e374fed3b /tools/testing
parent5744de542dd4b963c2975e6f70844ce2899864e4 (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')
-rw-r--r--tools/testing/selftests/powerpc/Makefile19
-rw-r--r--tools/testing/selftests/powerpc/copyloops/Makefile15
-rw-r--r--tools/testing/selftests/powerpc/mm/Makefile15
-rw-r--r--tools/testing/selftests/powerpc/pmu/Makefile48
-rw-r--r--tools/testing/selftests/powerpc/pmu/ebb/Makefile13
-rw-r--r--tools/testing/selftests/powerpc/primitives/Makefile15
-rw-r--r--tools/testing/selftests/powerpc/stringloops/Makefile15
-rw-r--r--tools/testing/selftests/powerpc/tm/Makefile15
8 files changed, 73 insertions, 82 deletions
diff --git a/tools/testing/selftests/powerpc/Makefile b/tools/testing/selftests/powerpc/Makefile
index 1d5e7ad2c460..22c4f8ffa422 100644
--- a/tools/testing/selftests/powerpc/Makefile
+++ b/tools/testing/selftests/powerpc/Makefile
@@ -22,10 +22,25 @@ all: $(TARGETS)
22$(TARGETS): 22$(TARGETS):
23 $(MAKE) -k -C $@ all 23 $(MAKE) -k -C $@ all
24 24
25run_tests: all 25include ../lib.mk
26
27override define RUN_TESTS
26 @for TARGET in $(TARGETS); do \ 28 @for TARGET in $(TARGETS); do \
27 $(MAKE) -C $$TARGET run_tests; \ 29 $(MAKE) -C $$TARGET run_tests; \
28 done; 30 done;
31endef
32
33override define INSTALL_RULE
34 @for TARGET in $(TARGETS); do \
35 $(MAKE) -C $$TARGET install; \
36 done;
37endef
38
39override define EMIT_TESTS
40 @for TARGET in $(TARGETS); do \
41 $(MAKE) -s -C $$TARGET emit_tests; \
42 done;
43endef
29 44
30clean: 45clean:
31 @for TARGET in $(TARGETS); do \ 46 @for TARGET in $(TARGETS); do \
@@ -36,4 +51,4 @@ clean:
36tags: 51tags:
37 find . -name '*.c' -o -name '*.h' | xargs ctags 52 find . -name '*.c' -o -name '*.h' | xargs ctags
38 53
39.PHONY: all run_tests clean tags $(TARGETS) 54.PHONY: tags $(TARGETS)
diff --git a/tools/testing/selftests/powerpc/copyloops/Makefile b/tools/testing/selftests/powerpc/copyloops/Makefile
index 6f2d3be227f9..c05023514ce8 100644
--- a/tools/testing/selftests/powerpc/copyloops/Makefile
+++ b/tools/testing/selftests/powerpc/copyloops/Makefile
@@ -6,24 +6,19 @@ CFLAGS += -D SELFTEST
6# Use our CFLAGS for the implicit .S rule 6# Use our CFLAGS for the implicit .S rule
7ASFLAGS = $(CFLAGS) 7ASFLAGS = $(CFLAGS)
8 8
9PROGS := copyuser_64 copyuser_power7 memcpy_64 memcpy_power7 9TEST_PROGS := copyuser_64 copyuser_power7 memcpy_64 memcpy_power7
10EXTRA_SOURCES := validate.c ../harness.c 10EXTRA_SOURCES := validate.c ../harness.c
11 11
12all: $(PROGS) 12all: $(TEST_PROGS)
13 13
14copyuser_64: CPPFLAGS += -D COPY_LOOP=test___copy_tofrom_user_base 14copyuser_64: CPPFLAGS += -D COPY_LOOP=test___copy_tofrom_user_base
15copyuser_power7: CPPFLAGS += -D COPY_LOOP=test___copy_tofrom_user_power7 15copyuser_power7: CPPFLAGS += -D COPY_LOOP=test___copy_tofrom_user_power7
16memcpy_64: CPPFLAGS += -D COPY_LOOP=test_memcpy 16memcpy_64: CPPFLAGS += -D COPY_LOOP=test_memcpy
17memcpy_power7: CPPFLAGS += -D COPY_LOOP=test_memcpy_power7 17memcpy_power7: CPPFLAGS += -D COPY_LOOP=test_memcpy_power7
18 18
19$(PROGS): $(EXTRA_SOURCES) 19$(TEST_PROGS): $(EXTRA_SOURCES)
20 20
21run_tests: all 21include ../../lib.mk
22 @-for PROG in $(PROGS); do \
23 ./$$PROG; \
24 done;
25 22
26clean: 23clean:
27 rm -f $(PROGS) *.o 24 rm -f $(TEST_PROGS) *.o
28
29.PHONY: all run_tests clean
diff --git a/tools/testing/selftests/powerpc/mm/Makefile b/tools/testing/selftests/powerpc/mm/Makefile
index a14c538dd7f8..41cc3ed66818 100644
--- a/tools/testing/selftests/powerpc/mm/Makefile
+++ b/tools/testing/selftests/powerpc/mm/Makefile
@@ -1,21 +1,16 @@
1noarg: 1noarg:
2 $(MAKE) -C ../ 2 $(MAKE) -C ../
3 3
4PROGS := hugetlb_vs_thp_test subpage_prot 4TEST_PROGS := hugetlb_vs_thp_test subpage_prot
5 5
6all: $(PROGS) tempfile 6all: $(TEST_PROGS) tempfile
7 7
8$(PROGS): ../harness.c 8$(TEST_PROGS): ../harness.c
9 9
10run_tests: all 10include ../../lib.mk
11 @-for PROG in $(PROGS); do \
12 ./$$PROG; \
13 done;
14 11
15tempfile: 12tempfile:
16 dd if=/dev/zero of=tempfile bs=64k count=1 13 dd if=/dev/zero of=tempfile bs=64k count=1
17 14
18clean: 15clean:
19 rm -f $(PROGS) tempfile 16 rm -f $(TEST_PROGS) tempfile
20
21.PHONY: all run_tests clean
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 @@
1noarg: 1noarg:
2 $(MAKE) -C ../ 2 $(MAKE) -C ../
3 3
4PROGS := count_instructions l3_bank_test per_event_excludes 4TEST_PROGS := count_instructions l3_bank_test per_event_excludes
5EXTRA_SOURCES := ../harness.c event.c lib.c 5EXTRA_SOURCES := ../harness.c event.c lib.c
6 6
7SUB_TARGETS = ebb 7all: $(TEST_PROGS) ebb
8 8
9all: $(PROGS) $(SUB_TARGETS) 9$(TEST_PROGS): $(EXTRA_SOURCES)
10
11$(PROGS): $(EXTRA_SOURCES)
12 10
13# loop.S can only be built 64-bit 11# loop.S can only be built 64-bit
14count_instructions: loop.S count_instructions.c $(EXTRA_SOURCES) 12count_instructions: loop.S count_instructions.c $(EXTRA_SOURCES)
15 $(CC) $(CFLAGS) -m64 -o $@ $^ 13 $(CC) $(CFLAGS) -m64 -o $@ $^
16 14
17run_tests: all sub_run_tests 15include ../../lib.mk
18 @-for PROG in $(PROGS); do \
19 ./$$PROG; \
20 done;
21 16
22clean: sub_clean 17DEFAULT_RUN_TESTS := $(RUN_TESTS)
23 rm -f $(PROGS) loop.o 18override define RUN_TESTS
19 $(DEFAULT_RUN_TESTS)
20 $(MAKE) -C ebb run_tests
21endef
24 22
25$(SUB_TARGETS): 23DEFAULT_EMIT_TESTS := $(EMIT_TESTS)
26 $(MAKE) -k -C $@ all 24override define EMIT_TESTS
25 $(DEFAULT_EMIT_TESTS)
26 $(MAKE) -s -C ebb emit_tests
27endef
27 28
28sub_run_tests: all 29DEFAULT_INSTALL := $(INSTALL_RULE)
29 @for TARGET in $(SUB_TARGETS); do \ 30override define INSTALL_RULE
30 $(MAKE) -C $$TARGET run_tests; \ 31 $(DEFAULT_INSTALL_RULE)
31 done; 32 $(MAKE) -C ebb install
33endef
32 34
33sub_clean: 35clean:
34 @for TARGET in $(SUB_TARGETS); do \ 36 rm -f $(TEST_PROGS) loop.o
35 $(MAKE) -C $$TARGET clean; \ 37 $(MAKE) -C ebb clean
36 done; 38
39ebb:
40 $(MAKE) -k -C $@ all
37 41
38.PHONY: all run_tests clean sub_run_tests sub_clean $(SUB_TARGETS) 42.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:
4# The EBB handler is 64-bit code and everything links against it 4# The EBB handler is 64-bit code and everything links against it
5CFLAGS += -m64 5CFLAGS += -m64
6 6
7PROGS := reg_access_test event_attributes_test cycles_test \ 7TEST_PROGS := reg_access_test event_attributes_test cycles_test \
8 cycles_with_freeze_test pmc56_overflow_test \ 8 cycles_with_freeze_test pmc56_overflow_test \
9 ebb_vs_cpu_event_test cpu_event_vs_ebb_test \ 9 ebb_vs_cpu_event_test cpu_event_vs_ebb_test \
10 cpu_event_pinned_vs_ebb_test task_event_vs_ebb_test \ 10 cpu_event_pinned_vs_ebb_test task_event_vs_ebb_test \
@@ -16,18 +16,15 @@ PROGS := reg_access_test event_attributes_test cycles_test \
16 lost_exception_test no_handler_test \ 16 lost_exception_test no_handler_test \
17 cycles_with_mmcr2_test 17 cycles_with_mmcr2_test
18 18
19all: $(PROGS) 19all: $(TEST_PROGS)
20 20
21$(PROGS): ../../harness.c ../event.c ../lib.c ebb.c ebb_handler.S trace.c busy_loop.S 21$(TEST_PROGS): ../../harness.c ../event.c ../lib.c ebb.c ebb_handler.S trace.c busy_loop.S
22 22
23instruction_count_test: ../loop.S 23instruction_count_test: ../loop.S
24 24
25lost_exception_test: ../lib.c 25lost_exception_test: ../lib.c
26 26
27run_tests: all 27include ../../../lib.mk
28 @-for PROG in $(PROGS); do \
29 ./$$PROG; \
30 done;
31 28
32clean: 29clean:
33 rm -f $(PROGS) 30 rm -f $(TEST_PROGS)
diff --git a/tools/testing/selftests/powerpc/primitives/Makefile b/tools/testing/selftests/powerpc/primitives/Makefile
index ea737ca01732..b68c6221d3d1 100644
--- a/tools/testing/selftests/powerpc/primitives/Makefile
+++ b/tools/testing/selftests/powerpc/primitives/Makefile
@@ -1,17 +1,12 @@
1CFLAGS += -I$(CURDIR) 1CFLAGS += -I$(CURDIR)
2 2
3PROGS := load_unaligned_zeropad 3TEST_PROGS := load_unaligned_zeropad
4 4
5all: $(PROGS) 5all: $(TEST_PROGS)
6 6
7$(PROGS): ../harness.c 7$(TEST_PROGS): ../harness.c
8 8
9run_tests: all 9include ../../lib.mk
10 @-for PROG in $(PROGS); do \
11 ./$$PROG; \
12 done;
13 10
14clean: 11clean:
15 rm -f $(PROGS) *.o 12 rm -f $(TEST_PROGS) *.o
16
17.PHONY: all run_tests clean
diff --git a/tools/testing/selftests/powerpc/stringloops/Makefile b/tools/testing/selftests/powerpc/stringloops/Makefile
index 506d77346477..2a728f4d2873 100644
--- a/tools/testing/selftests/powerpc/stringloops/Makefile
+++ b/tools/testing/selftests/powerpc/stringloops/Makefile
@@ -2,19 +2,14 @@
2CFLAGS += -m64 2CFLAGS += -m64
3CFLAGS += -I$(CURDIR) 3CFLAGS += -I$(CURDIR)
4 4
5PROGS := memcmp 5TEST_PROGS := memcmp
6EXTRA_SOURCES := memcmp_64.S ../harness.c 6EXTRA_SOURCES := memcmp_64.S ../harness.c
7 7
8all: $(PROGS) 8all: $(TEST_PROGS)
9 9
10$(PROGS): $(EXTRA_SOURCES) 10$(TEST_PROGS): $(EXTRA_SOURCES)
11 11
12run_tests: all 12include ../../lib.mk
13 @-for PROG in $(PROGS); do \
14 ./$$PROG; \
15 done;
16 13
17clean: 14clean:
18 rm -f $(PROGS) *.o 15 rm -f $(TEST_PROGS) *.o
19
20.PHONY: all run_tests clean
diff --git a/tools/testing/selftests/powerpc/tm/Makefile b/tools/testing/selftests/powerpc/tm/Makefile
index 2cede239a074..34f2ec634b40 100644
--- a/tools/testing/selftests/powerpc/tm/Makefile
+++ b/tools/testing/selftests/powerpc/tm/Makefile
@@ -1,15 +1,10 @@
1PROGS := tm-resched-dscr 1TEST_PROGS := tm-resched-dscr
2 2
3all: $(PROGS) 3all: $(TEST_PROGS)
4 4
5$(PROGS): ../harness.c 5$(TEST_PROGS): ../harness.c
6 6
7run_tests: all 7include ../../lib.mk
8 @-for PROG in $(PROGS); do \
9 ./$$PROG; \
10 done;
11 8
12clean: 9clean:
13 rm -f $(PROGS) *.o 10 rm -f $(TEST_PROGS) *.o
14
15.PHONY: all run_tests clean