aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShuah Khan <shuahkh@osg.samsung.com>2014-10-03 11:06:22 -0400
committerShuah Khan <shuahkh@osg.samsung.com>2014-11-17 12:39:08 -0500
commitb36169041c07378aa17e8afff643aed89be9acd4 (patch)
tree19ca68cddcc6ec3bae3752f4594ee94faa1fb96a
parent7fb2c3ea28bf7b748923a7cd58b6f49bce491bb7 (diff)
selftests/breakpoints: change test to use ksft framework
Change breakpoints test to use kselftest framework to report test results. Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
-rw-r--r--tools/testing/selftests/breakpoints/breakpoint_test.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/tools/testing/selftests/breakpoints/breakpoint_test.c b/tools/testing/selftests/breakpoints/breakpoint_test.c
index a0743f3b2b57..120895ab5505 100644
--- a/tools/testing/selftests/breakpoints/breakpoint_test.c
+++ b/tools/testing/selftests/breakpoints/breakpoint_test.c
@@ -17,6 +17,8 @@
17#include <sys/types.h> 17#include <sys/types.h>
18#include <sys/wait.h> 18#include <sys/wait.h>
19 19
20#include "../kselftest.h"
21
20 22
21/* Breakpoint access modes */ 23/* Breakpoint access modes */
22enum { 24enum {
@@ -42,7 +44,7 @@ static void set_breakpoint_addr(void *addr, int n)
42 offsetof(struct user, u_debugreg[n]), addr); 44 offsetof(struct user, u_debugreg[n]), addr);
43 if (ret) { 45 if (ret) {
44 perror("Can't set breakpoint addr\n"); 46 perror("Can't set breakpoint addr\n");
45 exit(-1); 47 ksft_exit_fail();
46 } 48 }
47} 49}
48 50
@@ -105,7 +107,7 @@ static void toggle_breakpoint(int n, int type, int len,
105 offsetof(struct user, u_debugreg[7]), dr7); 107 offsetof(struct user, u_debugreg[7]), dr7);
106 if (ret) { 108 if (ret) {
107 perror("Can't set dr7"); 109 perror("Can't set dr7");
108 exit(-1); 110 ksft_exit_fail();
109 } 111 }
110} 112}
111 113
@@ -275,7 +277,7 @@ static void check_success(const char *msg)
275 msg2 = "Ok"; 277 msg2 = "Ok";
276 if (ptrace(PTRACE_POKEDATA, child_pid, &trapped, 1)) { 278 if (ptrace(PTRACE_POKEDATA, child_pid, &trapped, 1)) {
277 perror("Can't poke\n"); 279 perror("Can't poke\n");
278 exit(-1); 280 ksft_exit_fail();
279 } 281 }
280 } 282 }
281 283
@@ -390,5 +392,5 @@ int main(int argc, char **argv)
390 392
391 wait(NULL); 393 wait(NULL);
392 394
393 return 0; 395 return ksft_exit_pass();
394} 396}