diff options
author | Shuah Khan <shuahkh@osg.samsung.com> | 2014-10-03 11:08:56 -0400 |
---|---|---|
committer | Shuah Khan <shuahkh@osg.samsung.com> | 2014-11-17 12:39:30 -0500 |
commit | 884716497d4c777f4b8798fab361b4bad351f5bc (patch) | |
tree | 13f3dae01019ae33f087c36b30ff0c163b6640ce /tools/testing | |
parent | e061bcd88573863daef2c67888ced5333b2ba536 (diff) |
selftests/timers: change test to use ksft framework
Change timers test to use kselftest framework to report
test results.
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Diffstat (limited to 'tools/testing')
-rw-r--r-- | tools/testing/selftests/timers/posix_timers.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/tools/testing/selftests/timers/posix_timers.c b/tools/testing/selftests/timers/posix_timers.c index 41bd85559d4b..f87d970a485c 100644 --- a/tools/testing/selftests/timers/posix_timers.c +++ b/tools/testing/selftests/timers/posix_timers.c | |||
@@ -15,6 +15,8 @@ | |||
15 | #include <time.h> | 15 | #include <time.h> |
16 | #include <pthread.h> | 16 | #include <pthread.h> |
17 | 17 | ||
18 | #include "../kselftest.h" | ||
19 | |||
18 | #define DELAY 2 | 20 | #define DELAY 2 |
19 | #define USECS_PER_SEC 1000000 | 21 | #define USECS_PER_SEC 1000000 |
20 | 22 | ||
@@ -194,16 +196,16 @@ int main(int argc, char **argv) | |||
194 | printf("based timers if other threads run on the CPU...\n"); | 196 | printf("based timers if other threads run on the CPU...\n"); |
195 | 197 | ||
196 | if (check_itimer(ITIMER_VIRTUAL) < 0) | 198 | if (check_itimer(ITIMER_VIRTUAL) < 0) |
197 | return -1; | 199 | return ksft_exit_fail(); |
198 | 200 | ||
199 | if (check_itimer(ITIMER_PROF) < 0) | 201 | if (check_itimer(ITIMER_PROF) < 0) |
200 | return -1; | 202 | return ksft_exit_fail(); |
201 | 203 | ||
202 | if (check_itimer(ITIMER_REAL) < 0) | 204 | if (check_itimer(ITIMER_REAL) < 0) |
203 | return -1; | 205 | return ksft_exit_fail(); |
204 | 206 | ||
205 | if (check_timer_create(CLOCK_THREAD_CPUTIME_ID) < 0) | 207 | if (check_timer_create(CLOCK_THREAD_CPUTIME_ID) < 0) |
206 | return -1; | 208 | return ksft_exit_fail(); |
207 | 209 | ||
208 | /* | 210 | /* |
209 | * It's unfortunately hard to reliably test a timer expiration | 211 | * It's unfortunately hard to reliably test a timer expiration |
@@ -215,7 +217,7 @@ int main(int argc, char **argv) | |||
215 | * find a better solution. | 217 | * find a better solution. |
216 | */ | 218 | */ |
217 | if (check_timer_create(CLOCK_PROCESS_CPUTIME_ID) < 0) | 219 | if (check_timer_create(CLOCK_PROCESS_CPUTIME_ID) < 0) |
218 | return -1; | 220 | return ksft_exit_fail(); |
219 | 221 | ||
220 | return 0; | 222 | return ksft_exit_pass(); |
221 | } | 223 | } |