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

0 commit comments

Comments
 (0)