1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
|
diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt
index 86a00bcc..5f5c36fb 100644
--- a/unittests/CMakeLists.txt
+++ b/unittests/CMakeLists.txt
@@ -1,6 +1,7 @@
enable_testing()
-include(${TF_3RD_PARTY_DIR}/doctest/doctest.cmake)
+find_package(doctest REQUIRED)
+include(doctest)
list(APPEND TF_UNITTESTS
utility
@@ -24,8 +25,7 @@ list(APPEND TF_UNITTESTS
foreach(unittest IN LISTS TF_UNITTESTS)
add_executable(${unittest} ${unittest}.cpp)
- target_link_libraries(${unittest} ${PROJECT_NAME} tf::default_settings)
- target_include_directories(${unittest} PRIVATE ${TF_3RD_PARTY_DIR}/doctest)
+ target_link_libraries(${unittest} ${PROJECT_NAME} tf::default_settings doctest::doctest)
doctest_discover_tests(${unittest})
endforeach()
diff --git a/unittests/algorithms.cpp b/unittests/algorithms.cpp
index a250713a..09ae9ba5 100644
--- a/unittests/algorithms.cpp
+++ b/unittests/algorithms.cpp
@@ -1,6 +1,6 @@
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
-#include <doctest.h>
+#include <doctest/doctest.h>
#include <taskflow/taskflow.hpp>
#include <taskflow/algorithm/reduce.hpp>
#include <taskflow/algorithm/sort.hpp>
diff --git a/unittests/asyncs.cpp b/unittests/asyncs.cpp
index 28eeaa8c..466687a2 100644
--- a/unittests/asyncs.cpp
+++ b/unittests/asyncs.cpp
@@ -1,6 +1,6 @@
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
-#include <doctest.h>
+#include <doctest/doctest.h>
#include <taskflow/taskflow.hpp>
// --------------------------------------------------------
diff --git a/unittests/basics.cpp b/unittests/basics.cpp
index 290abccf..44301011 100644
--- a/unittests/basics.cpp
+++ b/unittests/basics.cpp
@@ -1,6 +1,6 @@
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
-#include <doctest.h>
+#include <doctest/doctest.h>
#include <taskflow/taskflow.hpp>
#include <taskflow/algorithm/reduce.hpp>
diff --git a/unittests/cancellation.cpp b/unittests/cancellation.cpp
index 3ce1cb8c..6543ee52 100644
--- a/unittests/cancellation.cpp
+++ b/unittests/cancellation.cpp
@@ -1,6 +1,6 @@
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
-#include <doctest.h>
+#include <doctest/doctest.h>
#include <taskflow/taskflow.hpp>
// EmptyFuture
diff --git a/unittests/compositions.cpp b/unittests/compositions.cpp
index 4fd621b5..e3c91e4c 100644
--- a/unittests/compositions.cpp
+++ b/unittests/compositions.cpp
@@ -1,6 +1,6 @@
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
-#include <doctest.h>
+#include <doctest/doctest.h>
#include <taskflow/taskflow.hpp>
// --------------------------------------------------------
diff --git a/unittests/control_flow.cpp b/unittests/control_flow.cpp
index 024ace84..11206384 100644
--- a/unittests/control_flow.cpp
+++ b/unittests/control_flow.cpp
@@ -1,6 +1,6 @@
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
-#include <doctest.h>
+#include <doctest/doctest.h>
#include <taskflow/taskflow.hpp>
// --------------------------------------------------------
diff --git a/unittests/cuda/CMakeLists.txt b/unittests/cuda/CMakeLists.txt
index d0ccc8e9..ccb46721 100644
--- a/unittests/cuda/CMakeLists.txt
+++ b/unittests/cuda/CMakeLists.txt
@@ -13,15 +13,14 @@ list(APPEND TF_CUDA_UNITTESTS
foreach(cudatest IN LISTS TF_CUDA_UNITTESTS)
add_executable(${cudatest} ${cudatest}.cu)
- target_link_libraries(${cudatest} ${PROJECT_NAME} tf::default_settings)
- target_include_directories(${cudatest} PRIVATE ${TF_3RD_PARTY_DIR}/doctest)
-
+ target_link_libraries(${cudatest} ${PROJECT_NAME} tf::default_settings doctest::doctest)
+
# avoid cmake 3.18+ warning
# we let nvcc to decide the flag if the architecture is not given
if(NOT CUDA_ARCHITECTURES)
set_property(TARGET ${cudatest} PROPERTY CUDA_ARCHITECTURES OFF)
endif()
-
+
doctest_discover_tests(${cudatest})
endforeach()
diff --git a/unittests/cuda/cuda_algorithms.cu b/unittests/cuda/cuda_algorithms.cu
index cccc04b4..47645273 100644
--- a/unittests/cuda/cuda_algorithms.cu
+++ b/unittests/cuda/cuda_algorithms.cu
@@ -1,6 +1,6 @@
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
-#include <doctest.h>
+#include <doctest/doctest.h>
#include <taskflow/taskflow.hpp>
#include <taskflow/cuda/cudaflow.hpp>
#include <taskflow/cuda/algorithm/for_each.hpp>
diff --git a/unittests/cuda/cuda_basics.cu b/unittests/cuda/cuda_basics.cu
index 8e0fdffd..f97c7822 100644
--- a/unittests/cuda/cuda_basics.cu
+++ b/unittests/cuda/cuda_basics.cu
@@ -1,6 +1,6 @@
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
-#include <doctest.h>
+#include <doctest/doctest.h>
#include <taskflow/taskflow.hpp>
#include <taskflow/cuda/cudaflow.hpp>
diff --git a/unittests/cuda/cuda_capturer_optimizer.cu b/unittests/cuda/cuda_capturer_optimizer.cu
index 86fcfb72..7cbcf0a5 100644
--- a/unittests/cuda/cuda_capturer_optimizer.cu
+++ b/unittests/cuda/cuda_capturer_optimizer.cu
@@ -1,6 +1,6 @@
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
-#include <doctest.h>
+#include <doctest/doctest.h>
#include <taskflow/taskflow.hpp>
#include <taskflow/cuda/cudaflow.hpp>
#include <taskflow/cuda/algorithm/for_each.hpp>
diff --git a/unittests/cuda/cuda_device.cu b/unittests/cuda/cuda_device.cu
index 49df36aa..fb68b29a 100644
--- a/unittests/cuda/cuda_device.cu
+++ b/unittests/cuda/cuda_device.cu
@@ -1,6 +1,6 @@
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
-#include <doctest.h>
+#include <doctest/doctest.h>
#include <taskflow/taskflow.hpp>
#include <taskflow/cuda/cudaflow.hpp>
diff --git a/unittests/cuda/cuda_kmeans.cu b/unittests/cuda/cuda_kmeans.cu
index 91495b59..c14d250f 100644
--- a/unittests/cuda/cuda_kmeans.cu
+++ b/unittests/cuda/cuda_kmeans.cu
@@ -1,6 +1,6 @@
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
-#include <doctest.h>
+#include <doctest/doctest.h>
#include <taskflow/taskflow.hpp>
#include <taskflow/cuda/cudaflow.hpp>
#include <taskflow/cuda/algorithm/for_each.hpp>
diff --git a/unittests/cuda/cuda_matrix.cu b/unittests/cuda/cuda_matrix.cu
index 8e9f2421..ec5386f4 100644
--- a/unittests/cuda/cuda_matrix.cu
+++ b/unittests/cuda/cuda_matrix.cu
@@ -1,6 +1,6 @@
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
-#include <doctest.h>
+#include <doctest/doctest.h>
#include <taskflow/taskflow.hpp>
#include <taskflow/cuda/cudaflow.hpp>
diff --git a/unittests/cuda/cuda_rebinds.cu b/unittests/cuda/cuda_rebinds.cu
index eb9218fa..92798dfd 100644
--- a/unittests/cuda/cuda_rebinds.cu
+++ b/unittests/cuda/cuda_rebinds.cu
@@ -1,6 +1,6 @@
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
-#include <doctest.h>
+#include <doctest/doctest.h>
#include <taskflow/taskflow.hpp>
#include <taskflow/cuda/cudaflow.hpp>
diff --git a/unittests/cuda/cuda_updates.cu b/unittests/cuda/cuda_updates.cu
index bdda539a..d8b52dcf 100644
--- a/unittests/cuda/cuda_updates.cu
+++ b/unittests/cuda/cuda_updates.cu
@@ -1,6 +1,6 @@
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
-#include <doctest.h>
+#include <doctest/doctest.h>
#include <taskflow/taskflow.hpp>
#include <taskflow/cuda/cudaflow.hpp>
diff --git a/unittests/movable.cpp b/unittests/movable.cpp
index 96ce9da3..d5e64b47 100644
--- a/unittests/movable.cpp
+++ b/unittests/movable.cpp
@@ -1,5 +1,5 @@
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
-#include <doctest.h>
+#include <doctest/doctest.h>
#include <taskflow/taskflow.hpp>
// increments a counter only on destruction
diff --git a/unittests/pipelines.cpp b/unittests/pipelines.cpp
index 94d8f394..701365c0 100644
--- a/unittests/pipelines.cpp
+++ b/unittests/pipelines.cpp
@@ -1,6 +1,6 @@
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
-#include <doctest.h>
+#include <doctest/doctest.h>
#include <taskflow/taskflow.hpp>
#include <taskflow/algorithm/pipeline.hpp>
diff --git a/unittests/runtimes.cpp b/unittests/runtimes.cpp
index 5a6155b5..4f7e5b74 100644
--- a/unittests/runtimes.cpp
+++ b/unittests/runtimes.cpp
@@ -1,6 +1,6 @@
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
-#include <doctest.h>
+#include <doctest/doctest.h>
#include <taskflow/taskflow.hpp>
#include <taskflow/algorithm/pipeline.hpp>
diff --git a/unittests/scalable_pipelines.cpp b/unittests/scalable_pipelines.cpp
index 2534878b..e2073563 100644
--- a/unittests/scalable_pipelines.cpp
+++ b/unittests/scalable_pipelines.cpp
@@ -1,6 +1,6 @@
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
-#include <doctest.h>
+#include <doctest/doctest.h>
#include <taskflow/taskflow.hpp>
#include <taskflow/algorithm/pipeline.hpp>
diff --git a/unittests/semaphores.cpp b/unittests/semaphores.cpp
index 616191b5..64b8a587 100644
--- a/unittests/semaphores.cpp
+++ b/unittests/semaphores.cpp
@@ -1,6 +1,6 @@
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
-#include <doctest.h>
+#include <doctest/doctest.h>
#include <taskflow/taskflow.hpp>
// --------------------------------------------------------
diff --git a/unittests/serializer.cpp b/unittests/serializer.cpp
index 92c3ec70..c6a715e6 100644
--- a/unittests/serializer.cpp
+++ b/unittests/serializer.cpp
@@ -1,6 +1,6 @@
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
-#include <doctest.h>
+#include <doctest/doctest.h>
#include <taskflow/utility/serializer.hpp>
#include <random>
diff --git a/unittests/sorting.cpp b/unittests/sorting.cpp
index 8146324a..ff732fb0 100644
--- a/unittests/sorting.cpp
+++ b/unittests/sorting.cpp
@@ -1,6 +1,6 @@
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
-#include <doctest.h>
+#include <doctest/doctest.h>
#include <taskflow/taskflow.hpp>
#include <taskflow/algorithm/sort.hpp>
diff --git a/unittests/subflows.cpp b/unittests/subflows.cpp
index 9db430de..e669a2c8 100644
--- a/unittests/subflows.cpp
+++ b/unittests/subflows.cpp
@@ -1,6 +1,6 @@
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
-#include <doctest.h>
+#include <doctest/doctest.h>
#include <taskflow/taskflow.hpp>
#include <taskflow/algorithm/reduce.hpp>
diff --git a/unittests/sycl/CMakeLists.txt b/unittests/sycl/CMakeLists.txt
index c6481996..3b014d0e 100644
--- a/unittests/sycl/CMakeLists.txt
+++ b/unittests/sycl/CMakeLists.txt
@@ -1,4 +1,4 @@
-list(APPEND TF_SYCL_TESTS
+list(APPEND TF_SYCL_TESTS
sycl_basics
#sycl_algorithms
#sycl_rebinds
@@ -12,9 +12,8 @@ foreach(sycl_test IN LISTS TF_SYCL_TESTS)
target_compile_options(${sycl_test} PRIVATE ${TF_SYCL_OPTIONS})
target_link_options(${sycl_test} PRIVATE ${TF_SYCL_OPTIONS})
target_link_libraries(${sycl_test}
- ${PROJECT_NAME} Threads::Threads tf::default_settings
+ ${PROJECT_NAME} Threads::Threads tf::default_settings doctest::doctest
)
- target_include_directories(${sycl_test} PRIVATE ${TF_3RD_PARTY_DIR}/doctest)
-
+
doctest_discover_tests(${sycl_test})
endforeach()
diff --git a/unittests/sycl/sycl_algorithms.cpp b/unittests/sycl/sycl_algorithms.cpp
index e029b2ef..7b44ca78 100644
--- a/unittests/sycl/sycl_algorithms.cpp
+++ b/unittests/sycl/sycl_algorithms.cpp
@@ -1,5 +1,5 @@
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
-#include <doctest.h>
+#include <doctest/doctest.h>
#include <taskflow/syclflow.hpp>
constexpr float eps = 0.0001f;
diff --git a/unittests/sycl/sycl_basics.cpp b/unittests/sycl/sycl_basics.cpp
index 0ff76969..eac52906 100644
--- a/unittests/sycl/sycl_basics.cpp
+++ b/unittests/sycl/sycl_basics.cpp
@@ -1,5 +1,5 @@
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
-#include <doctest.h>
+#include <doctest/doctest.h>
#include <taskflow/sycl/syclflow.hpp>
// task creation
diff --git a/unittests/sycl/sycl_rebinds.cpp b/unittests/sycl/sycl_rebinds.cpp
index 71b2f9de..1b5949fd 100644
--- a/unittests/sycl/sycl_rebinds.cpp
+++ b/unittests/sycl/sycl_rebinds.cpp
@@ -1,5 +1,5 @@
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
-#include <doctest.h>
+#include <doctest/doctest.h>
#include <taskflow/syclflow.hpp>
// ----------------------------------------------------------------------------
diff --git a/unittests/traversals.cpp b/unittests/traversals.cpp
index 71aef04b..683915b4 100644
--- a/unittests/traversals.cpp
+++ b/unittests/traversals.cpp
@@ -1,6 +1,6 @@
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
-#include <doctest.h>
+#include <doctest/doctest.h>
#include <taskflow/taskflow.hpp>
diff --git a/unittests/tsq.cpp b/unittests/tsq.cpp
index 51a137a7..8e9cac56 100644
--- a/unittests/tsq.cpp
+++ b/unittests/tsq.cpp
@@ -49,7 +49,7 @@
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
-#include <doctest.h>
+#include <doctest/doctest.h>
#include <taskflow/taskflow.hpp>
// ============================================================================
diff --git a/unittests/utility.cpp b/unittests/utility.cpp
index 63c49708..01ee81a3 100644
--- a/unittests/utility.cpp
+++ b/unittests/utility.cpp
@@ -1,6 +1,6 @@
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
-#include <doctest.h>
+#include <doctest/doctest.h>
#include <taskflow/utility/traits.hpp>
#include <taskflow/utility/object_pool.hpp>
|