Skip to content

Commit b841065

Browse files
author
Shuah Khan
committed
selftests: timers: drop support for !KTEST case
There is no need to keep timers tests in sync with external timers repo. Drop support for !KTEST to support for building and running timers tests without kselftest framework. Reference: https://lkml.org/lkml/2017/8/10/952 Signed-off-by: Shuah Khan <[email protected]> Acked-by: John Stultz <[email protected]>
1 parent 4db26f9 commit b841065

19 files changed

+1
-204
lines changed

tools/testing/selftests/timers/Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
BUILD_FLAGS = -DKTEST
2-
CFLAGS += -O3 -Wl,-no-as-needed -Wall $(BUILD_FLAGS)
1+
CFLAGS += -O3 -Wl,-no-as-needed -Wall
32
LDFLAGS += -lrt -lpthread -lm
43

54
# these are all "safe" tests that don't modify

tools/testing/selftests/timers/adjtick.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,7 @@
2323
#include <sys/timex.h>
2424
#include <time.h>
2525

26-
#ifdef KTEST
2726
#include "../kselftest.h"
28-
#else
29-
static inline int ksft_exit_pass(void)
30-
{
31-
exit(0);
32-
}
33-
static inline int ksft_exit_fail(void)
34-
{
35-
exit(1);
36-
}
37-
#endif
3827

3928
#define CLOCK_MONOTONIC_RAW 4
4029

tools/testing/selftests/timers/alarmtimer-suspend.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,7 @@
2828
#include <signal.h>
2929
#include <stdlib.h>
3030
#include <pthread.h>
31-
#ifdef KTEST
3231
#include "../kselftest.h"
33-
#else
34-
static inline int ksft_exit_pass(void)
35-
{
36-
exit(0);
37-
}
38-
static inline int ksft_exit_fail(void)
39-
{
40-
exit(1);
41-
}
42-
#endif
4332

4433
#define CLOCK_REALTIME 0
4534
#define CLOCK_MONOTONIC 1

tools/testing/selftests/timers/change_skew.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,7 @@
2828
#include <sys/time.h>
2929
#include <sys/timex.h>
3030
#include <time.h>
31-
#ifdef KTEST
3231
#include "../kselftest.h"
33-
#else
34-
static inline int ksft_exit_pass(void)
35-
{
36-
exit(0);
37-
}
38-
static inline int ksft_exit_fail(void)
39-
{
40-
exit(1);
41-
}
42-
#endif
4332

4433
#define NSEC_PER_SEC 1000000000LL
4534

tools/testing/selftests/timers/clocksource-switch.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,7 @@
3434
#include <fcntl.h>
3535
#include <string.h>
3636
#include <sys/wait.h>
37-
#ifdef KTEST
3837
#include "../kselftest.h"
39-
#else
40-
static inline int ksft_exit_pass(void)
41-
{
42-
exit(0);
43-
}
44-
static inline int ksft_exit_fail(void)
45-
{
46-
exit(1);
47-
}
48-
#endif
4938

5039

5140
int get_clocksources(char list[][30])

tools/testing/selftests/timers/inconsistency-check.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,7 @@
2828
#include <sys/timex.h>
2929
#include <string.h>
3030
#include <signal.h>
31-
#ifdef KTEST
3231
#include "../kselftest.h"
33-
#else
34-
static inline int ksft_exit_pass(void)
35-
{
36-
exit(0);
37-
}
38-
static inline int ksft_exit_fail(void)
39-
{
40-
exit(1);
41-
}
42-
#endif
4332

4433
#define CALLS_PER_LOOP 64
4534
#define NSEC_PER_SEC 1000000000ULL

tools/testing/selftests/timers/leap-a-day.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,7 @@
4848
#include <string.h>
4949
#include <signal.h>
5050
#include <unistd.h>
51-
#ifdef KTEST
5251
#include "../kselftest.h"
53-
#else
54-
static inline int ksft_exit_pass(void)
55-
{
56-
exit(0);
57-
}
58-
static inline int ksft_exit_fail(void)
59-
{
60-
exit(1);
61-
}
62-
#endif
6352

6453
#define NSEC_PER_SEC 1000000000ULL
6554
#define CLOCK_TAI 11

tools/testing/selftests/timers/leapcrash.c

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,7 @@
2222
#include <sys/timex.h>
2323
#include <string.h>
2424
#include <signal.h>
25-
#ifdef KTEST
2625
#include "../kselftest.h"
27-
#else
28-
static inline int ksft_exit_pass(void)
29-
{
30-
exit(0);
31-
}
32-
static inline int ksft_exit_fail(void)
33-
{
34-
exit(1);
35-
}
36-
#endif
37-
38-
3926

4027
/* clear NTP time_status & time_state */
4128
int clear_time_state(void)

tools/testing/selftests/timers/mqueue-lat.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,7 @@
2929
#include <signal.h>
3030
#include <errno.h>
3131
#include <mqueue.h>
32-
#ifdef KTEST
3332
#include "../kselftest.h"
34-
#else
35-
static inline int ksft_exit_pass(void)
36-
{
37-
exit(0);
38-
}
39-
static inline int ksft_exit_fail(void)
40-
{
41-
exit(1);
42-
}
43-
#endif
4433

4534
#define NSEC_PER_SEC 1000000000ULL
4635

tools/testing/selftests/timers/nanosleep.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,7 @@
2727
#include <sys/timex.h>
2828
#include <string.h>
2929
#include <signal.h>
30-
#ifdef KTEST
3130
#include "../kselftest.h"
32-
#else
33-
static inline int ksft_exit_pass(void)
34-
{
35-
exit(0);
36-
}
37-
static inline int ksft_exit_fail(void)
38-
{
39-
exit(1);
40-
}
41-
#endif
4231

4332
#define NSEC_PER_SEC 1000000000ULL
4433

tools/testing/selftests/timers/nsleep-lat.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,7 @@
2424
#include <sys/timex.h>
2525
#include <string.h>
2626
#include <signal.h>
27-
#ifdef KTEST
2827
#include "../kselftest.h"
29-
#else
30-
static inline int ksft_exit_pass(void)
31-
{
32-
exit(0);
33-
}
34-
static inline int ksft_exit_fail(void)
35-
{
36-
exit(1);
37-
}
38-
#endif
3928

4029
#define NSEC_PER_SEC 1000000000ULL
4130

tools/testing/selftests/timers/raw_skew.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,7 @@
2525
#include <sys/time.h>
2626
#include <sys/timex.h>
2727
#include <time.h>
28-
#ifdef KTEST
2928
#include "../kselftest.h"
30-
#else
31-
static inline int ksft_exit_pass(void)
32-
{
33-
exit(0);
34-
}
35-
static inline int ksft_exit_fail(void)
36-
{
37-
exit(1);
38-
}
39-
#endif
40-
4129

4230
#define CLOCK_MONOTONIC_RAW 4
4331
#define NSEC_PER_SEC 1000000000LL

tools/testing/selftests/timers/set-2038.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,7 @@
2727
#include <unistd.h>
2828
#include <time.h>
2929
#include <sys/time.h>
30-
#ifdef KTEST
3130
#include "../kselftest.h"
32-
#else
33-
static inline int ksft_exit_pass(void)
34-
{
35-
exit(0);
36-
}
37-
static inline int ksft_exit_fail(void)
38-
{
39-
exit(1);
40-
}
41-
#endif
4231

4332
#define NSEC_PER_SEC 1000000000LL
4433

tools/testing/selftests/timers/set-tai.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,7 @@
2323
#include <string.h>
2424
#include <signal.h>
2525
#include <unistd.h>
26-
#ifdef KTEST
2726
#include "../kselftest.h"
28-
#else
29-
static inline int ksft_exit_pass(void)
30-
{
31-
exit(0);
32-
}
33-
static inline int ksft_exit_fail(void)
34-
{
35-
exit(1);
36-
}
37-
#endif
3827

3928
int set_tai(int offset)
4029
{

tools/testing/selftests/timers/set-timer-lat.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,7 @@
2727
#include <signal.h>
2828
#include <stdlib.h>
2929
#include <pthread.h>
30-
#ifdef KTEST
3130
#include "../kselftest.h"
32-
#else
33-
static inline int ksft_exit_pass(void)
34-
{
35-
exit(0);
36-
}
37-
static inline int ksft_exit_fail(void)
38-
{
39-
exit(1);
40-
}
41-
#endif
4231

4332
#define CLOCK_REALTIME 0
4433
#define CLOCK_MONOTONIC 1

tools/testing/selftests/timers/set-tz.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,7 @@
2323
#include <string.h>
2424
#include <signal.h>
2525
#include <unistd.h>
26-
#ifdef KTEST
2726
#include "../kselftest.h"
28-
#else
29-
static inline int ksft_exit_pass(void)
30-
{
31-
exit(0);
32-
}
33-
static inline int ksft_exit_fail(void)
34-
{
35-
exit(1);
36-
}
37-
#endif
3827

3928
int set_tz(int min, int dst)
4029
{

tools/testing/selftests/timers/skew_consistency.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,7 @@
3535
#include <stdlib.h>
3636
#include <string.h>
3737
#include <sys/wait.h>
38-
#ifdef KTEST
3938
#include "../kselftest.h"
40-
#else
41-
static inline int ksft_exit_pass(void)
42-
{
43-
exit(0);
44-
}
45-
static inline int ksft_exit_fail(void)
46-
{
47-
exit(1);
48-
}
49-
#endif
5039

5140
#define NSEC_PER_SEC 1000000000LL
5241

tools/testing/selftests/timers/threadtest.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,7 @@
2121
#include <stdlib.h>
2222
#include <sys/time.h>
2323
#include <pthread.h>
24-
#ifdef KTEST
2524
#include "../kselftest.h"
26-
#else
27-
static inline int ksft_exit_pass(void)
28-
{
29-
exit(0);
30-
}
31-
static inline int ksft_exit_fail(void)
32-
{
33-
exit(1);
34-
}
35-
#endif
36-
3725

3826
/* serializes shared list access */
3927
pthread_mutex_t list_lock = PTHREAD_MUTEX_INITIALIZER;

tools/testing/selftests/timers/valid-adjtimex.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,7 @@
3232
#include <string.h>
3333
#include <signal.h>
3434
#include <unistd.h>
35-
#ifdef KTEST
3635
#include "../kselftest.h"
37-
#else
38-
static inline int ksft_exit_pass(void)
39-
{
40-
exit(0);
41-
}
42-
static inline int ksft_exit_fail(void)
43-
{
44-
exit(1);
45-
}
46-
#endif
4736

4837
#define NSEC_PER_SEC 1000000000LL
4938
#define USEC_PER_SEC 1000000LL

0 commit comments

Comments
 (0)