File tree 3 files changed +13
-2
lines changed
3 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,11 @@ TESTS= \
74
74
dispatch_select \
75
75
$(ADDITIONAL_TESTS )
76
76
77
+ # For testing in swift.org CI system; make deadlines lenient by default
78
+ # to reduce probability of test failures due to machine load.
79
+ if HAVE_SWIFT
80
+ CI_CFLAGS=-DLENIENT_DEADLINES =1
81
+ endif
77
82
78
83
dispatch_c99_CFLAGS =$(DISPATCH_TESTS_CFLAGS ) $(CBLOCKS_FLAGS ) -std=c99
79
84
dispatch_plusplus_SOURCES =dispatch_plusplus.cpp
@@ -82,7 +87,7 @@ dispatch_priority2_CPPFLAGS=$(AM_CPPFLAGS) -DUSE_SET_TARGET_QUEUE=1
82
87
83
88
AM_CPPFLAGS =-I$(top_builddir ) -I$(top_srcdir )
84
89
85
- DISPATCH_TESTS_CFLAGS =-Wall -Wno-deprecated-declarations $(MARCH_FLAGS )
90
+ DISPATCH_TESTS_CFLAGS =-Wall -Wno-deprecated-declarations $(MARCH_FLAGS ) $( CI_CFLAGS )
86
91
AM_CFLAGS =$(DISPATCH_TESTS_CFLAGS ) $(CBLOCKS_FLAGS ) $(BSD_OVERLAY_CFLAGS )
87
92
AM_OBJCFLAGS =$(DISPATCH_TESTS_CFLAGS ) $(CBLOCKS_FLAGS )
88
93
AM_CXXFLAGS =$(DISPATCH_TESTS_CFLAGS ) $(CXXBLOCKS_FLAGS ) $(BSD_OVERLAY_CFLAGS )
Original file line number Diff line number Diff line change 32
32
#include <bsdtests.h>
33
33
#include "dispatch_test.h"
34
34
35
+ #if LENIENT_DEADLINES
36
+ #define ACCEPTABLE_DRIFT 0.1
37
+ #else
35
38
#define ACCEPTABLE_DRIFT 0.001
39
+ #endif
36
40
37
41
int
38
42
main (int argc __attribute__((unused )), char * argv [] __attribute__((unused )))
Original file line number Diff line number Diff line change 37
37
#define COUNT 1000ul
38
38
#define LAPS 10ul
39
39
40
- #if TARGET_OS_EMBEDDED
40
+ #if LENIENT_DEADLINES
41
+ #define ACCEPTABLE_LATENCY 10000
42
+ #elif TARGET_OS_EMBEDDED
41
43
#define ACCEPTABLE_LATENCY 3000
42
44
#else
43
45
#define ACCEPTABLE_LATENCY 1000
You can’t perform that action at this time.
0 commit comments