diff options
Diffstat (limited to 'tools/testing/selftests/kcmp')
-rw-r--r-- | tools/testing/selftests/kcmp/Makefile | 6 | ||||
-rw-r--r-- | tools/testing/selftests/kcmp/kcmp_test.c | 6 |
2 files changed, 7 insertions, 5 deletions
diff --git a/tools/testing/selftests/kcmp/Makefile b/tools/testing/selftests/kcmp/Makefile index dc79b86ea65c..56eb5523dbb8 100644 --- a/tools/testing/selftests/kcmp/Makefile +++ b/tools/testing/selftests/kcmp/Makefile | |||
@@ -16,13 +16,13 @@ CFLAGS += -I../../../../arch/x86/include/ | |||
16 | 16 | ||
17 | all: | 17 | all: |
18 | ifeq ($(ARCH),X86) | 18 | ifeq ($(ARCH),X86) |
19 | gcc $(CFLAGS) kcmp_test.c -o run_test | 19 | gcc $(CFLAGS) kcmp_test.c -o kcmp_test |
20 | else | 20 | else |
21 | echo "Not an x86 target, can't build kcmp selftest" | 21 | echo "Not an x86 target, can't build kcmp selftest" |
22 | endif | 22 | endif |
23 | 23 | ||
24 | run-tests: all | 24 | run_tests: all |
25 | ./kcmp_test | 25 | @./kcmp_test || echo "kcmp_test: [FAIL]" |
26 | 26 | ||
27 | clean: | 27 | clean: |
28 | rm -fr ./run_test | 28 | rm -fr ./run_test |
diff --git a/tools/testing/selftests/kcmp/kcmp_test.c b/tools/testing/selftests/kcmp/kcmp_test.c index 358cc6bfa35d..fa4f1b37e045 100644 --- a/tools/testing/selftests/kcmp/kcmp_test.c +++ b/tools/testing/selftests/kcmp/kcmp_test.c | |||
@@ -72,7 +72,8 @@ int main(int argc, char **argv) | |||
72 | /* This one should return same fd */ | 72 | /* This one should return same fd */ |
73 | ret = sys_kcmp(pid1, pid2, KCMP_FILE, fd1, fd1); | 73 | ret = sys_kcmp(pid1, pid2, KCMP_FILE, fd1, fd1); |
74 | if (ret) { | 74 | if (ret) { |
75 | printf("FAIL: 0 expected but %d returned\n", ret); | 75 | printf("FAIL: 0 expected but %d returned (%s)\n", |
76 | ret, strerror(errno)); | ||
76 | ret = -1; | 77 | ret = -1; |
77 | } else | 78 | } else |
78 | printf("PASS: 0 returned as expected\n"); | 79 | printf("PASS: 0 returned as expected\n"); |
@@ -80,7 +81,8 @@ int main(int argc, char **argv) | |||
80 | /* Compare with self */ | 81 | /* Compare with self */ |
81 | ret = sys_kcmp(pid1, pid1, KCMP_VM, 0, 0); | 82 | ret = sys_kcmp(pid1, pid1, KCMP_VM, 0, 0); |
82 | if (ret) { | 83 | if (ret) { |
83 | printf("FAIL: 0 expected but %li returned\n", ret); | 84 | printf("FAIL: 0 expected but %li returned (%s)\n", |
85 | ret, strerror(errno)); | ||
84 | ret = -1; | 86 | ret = -1; |
85 | } else | 87 | } else |
86 | printf("PASS: 0 returned as expected\n"); | 88 | printf("PASS: 0 returned as expected\n"); |