selftests/timers: change test to use ksft framework
authorShuah Khan <shuahkh@osg.samsung.com>
Fri, 3 Oct 2014 15:08:56 +0000 (09:08 -0600)
committerShuah Khan <shuahkh@osg.samsung.com>
Mon, 17 Nov 2014 17:39:30 +0000 (10:39 -0700)
Change timers test to use kselftest framework to report
test results.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
tools/testing/selftests/timers/posix_timers.c

index 41bd85559d4b01aa8ee0e89615ece47c4115b0d0..f87d970a485c48b7d10e304e911fd3699c41bb35 100644 (file)
@@ -15,6 +15,8 @@
 #include <time.h>
 #include <pthread.h>
 
+#include "../kselftest.h"
+
 #define DELAY 2
 #define USECS_PER_SEC 1000000
 
@@ -194,16 +196,16 @@ int main(int argc, char **argv)
        printf("based timers if other threads run on the CPU...\n");
 
        if (check_itimer(ITIMER_VIRTUAL) < 0)
-               return -1;
+               return ksft_exit_fail();
 
        if (check_itimer(ITIMER_PROF) < 0)
-               return -1;
+               return ksft_exit_fail();
 
        if (check_itimer(ITIMER_REAL) < 0)
-               return -1;
+               return ksft_exit_fail();
 
        if (check_timer_create(CLOCK_THREAD_CPUTIME_ID) < 0)
-               return -1;
+               return ksft_exit_fail();
 
        /*
         * It's unfortunately hard to reliably test a timer expiration
@@ -215,7 +217,7 @@ int main(int argc, char **argv)
         * find a better solution.
         */
        if (check_timer_create(CLOCK_PROCESS_CPUTIME_ID) < 0)
-               return -1;
+               return ksft_exit_fail();
 
-       return 0;
+       return ksft_exit_pass();
 }
This page took 0.041552 seconds and 5 git commands to generate.