@@ -74,6 +74,11 @@ function(add_unit_test name)
74
74
${CMAKE_CURRENT_BINARY_DIR}
75
75
${CMAKE_CURRENT_SOURCE_DIR}
76
76
${CMAKE_SOURCE_DIR} )
77
+ if (CMAKE_SWIFT_COMPILER )
78
+ # For testing in swift.org CI system; make deadlines lenient by default
79
+ # to reduce probability of test failures due to machine load.
80
+ target_compile_options (${name} PRIVATE -DLENIENT_DEADLINES=1 )
81
+ endif ()
77
82
if (WITH_BLOCKS_RUNTIME )
78
83
target_include_directories (${name}
79
84
SYSTEM BEFORE PRIVATE
@@ -141,6 +146,34 @@ set(DISPATCH_C_TESTS
141
146
set (DISPATCH_CPP_TESTS
142
147
plusplus )
143
148
149
+ # Tests that usually pass, but occasionally fail
150
+ # and are therefore not suitable for general CI usage.
151
+ if (EXTENDED_TEST_SUITE )
152
+ list (APPEND DISPATCH_C_TESTS
153
+ priority
154
+ concur
155
+ read
156
+ read2
157
+ suspend_timer
158
+ pingpong
159
+ drift
160
+ readsync
161
+ cascade
162
+ io )
163
+ # an oddball; dispatch_priority.c compiled with -DUSE_SET_TARGET_QUEUE=1
164
+ add_unit_test (dispatch_priority2 SOURCES dispatch_priority.c )
165
+ target_compile_options (dispatch_priority2 PRIVATE -DUSE_SET_TARGET_QUEUE=1 )
166
+ endif ()
167
+
168
+ # Tests for platform-specific functionality
169
+ if (CMAKE_SYSTEM_NAME STREQUAL Darwin )
170
+ list (APPEND DISPATCH_C_TESTS
171
+ deadname
172
+ proc
173
+ vm
174
+ vnode )
175
+ endif ()
176
+
144
177
foreach (test ${DISPATCH_C_TESTS} )
145
178
add_unit_test (dispatch_${test}
146
179
SOURCES
@@ -151,6 +184,10 @@ foreach(test ${DISPATCH_CPP_TESTS})
151
184
SOURCES
152
185
dispatch_${test}.cpp )
153
186
endforeach ()
187
+
188
+ # test-specific link options
154
189
target_link_libraries (dispatch_group PRIVATE m )
155
190
target_link_libraries (dispatch_timer_short PRIVATE m )
156
191
192
+ # test-specific compile options
193
+ target_compile_options (dispatch_c99 PRIVATE -std=c99 )
0 commit comments