lkml.org 
[lkml]   [2017]   [Aug]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 3/3] selftests: timers: freq-step: to work without ksft framework
Date
Fix to build and run without ksft framework like the other timers tests.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
---
tools/testing/selftests/timers/freq-step.c | 4 ++++
tools/testing/selftests/timers/kselftest_stubs.h | 1 +
2 files changed, 5 insertions(+)

diff --git a/tools/testing/selftests/timers/freq-step.c b/tools/testing/selftests/timers/freq-step.c
index 22312eb4c941..a0438eb655c4 100644
--- a/tools/testing/selftests/timers/freq-step.c
+++ b/tools/testing/selftests/timers/freq-step.c
@@ -23,7 +23,11 @@
#include <time.h>
#include <unistd.h>

+#ifdef KTEST
#include "../kselftest.h"
+#else
+#include "kselftest_stubs.h"
+#endif

#define SAMPLES 100
#define SAMPLE_READINGS 10
diff --git a/tools/testing/selftests/timers/kselftest_stubs.h b/tools/testing/selftests/timers/kselftest_stubs.h
index 9d2490f3932f..62e3cd36b17d 100644
--- a/tools/testing/selftests/timers/kselftest_stubs.h
+++ b/tools/testing/selftests/timers/kselftest_stubs.h
@@ -18,5 +18,6 @@

static inline int ksft_exit_pass(void) { exit(0); }
static inline int ksft_exit_fail(void) { exit(1); }
+static inline int ksft_exit_skip(const char *msg, ...) { exit(4); }

#endif /* __KSELFTEST__STUBS_H */
--
2.11.0
\
 
 \ /
  Last update: 2017-08-11 01:53    [W:0.088 / U:1.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site