forked from heavyai/heavydb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
561 lines (519 loc) · 23.4 KB
/
CMakeLists.txt
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
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR})
include_directories(${CMAKE_CURRENT_BINARY_DIR})
set(TEST_BASE_PATH "./tmp")
add_definitions("-DBASE_PATH=\"${TEST_BASE_PATH}\"")
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/Udf/udf_sample.cpp DESTINATION ${CMAKE_BINARY_DIR}/Tests/Udf)
add_executable(CodeGeneratorTest CodeGeneratorTest.cpp)
add_executable(ExecuteTest ExecuteTest.cpp ClusterTester.cpp)
add_executable(GeospatialTest GeospatialTest.cpp)
add_executable(RunQueryLoop RunQueryLoop.cpp)
add_executable(StringDictionaryTest StringDictionaryTest.cpp)
add_executable(StringTransformTest StringTransformTest.cpp)
add_executable(StringFunctionsTest StringFunctionsTest.cpp)
add_executable(ForeignServerDdlTest ForeignServerDdlTest.cpp)
add_executable(ShowCommandsDdlTest ShowCommandsDdlTest.cpp)
add_executable(AlterSystemTest AlterSystemTest.cpp)
add_executable(CatalogMigrationTest CatalogMigrationTest.cpp)
add_executable(CreateAndDropTableDdlTest CreateAndDropTableDdlTest.cpp)
add_executable(ForeignTableDmlTest ForeignTableDmlTest.cpp)
add_executable(DashboardAndCustomExpressionTest DashboardAndCustomExpressionTest.cpp)
add_executable(FileMgrTest FileMgrTest.cpp)
add_executable(FilePathWhitelistTest FilePathWhitelistTest.cpp)
add_executable(EncoderTest EncoderTest.cpp)
add_executable(ForeignStorageCacheTest ForeignStorageCacheTest.cpp)
add_executable(PersistentStorageTest PersistentStorageTest.cpp)
add_executable(ShardedTableEpochConsistencyTest ShardedTableEpochConsistencyTest.cpp)
add_executable(DiskCacheQueryTest DiskCacheQueryTest.cpp)
add_executable(CachingFileMgrTest CachingFileMgrTest.cpp)
if(NOT MSVC)
add_executable(JSONTest JSONTest.cpp)
endif()
add_executable(DataRecyclerTest DataRecyclerTest.cpp)
add_executable(DataMgrTest DataMgrTest.cpp)
if(ENABLE_CUDA)
message(DEBUG "Tests CUDA_COMPILATION_ARCH: ${CUDA_COMPILATION_ARCH}")
set(MAPD_DEFINITIONS -DHAVE_CUDA)
if (SUPPRESS_NULL_LOGGER_DEPRECATION_WARNINGS)
list(APPEND MAPD_DEFINITIONS -DSUPPRESS_NULL_LOGGER_DEPRECATION_WARNINGS)
endif()
endif()
add_executable(DumpRestoreTest DumpRestoreTest.cpp)
add_executable(ResultSetTest ResultSetTest.cpp ResultSetTestUtils.cpp)
add_executable(FromTableReorderingTest FromTableReorderingTest.cpp)
add_executable(ResultSetBaselineRadixSortTest ResultSetBaselineRadixSortTest.cpp ResultSetTestUtils.cpp)
add_executable(UtilTest UtilTest.cpp)
add_executable(StorageTest StorageTest.cpp PopulateTableRandom.cpp ScanTable.cpp)
add_executable(StoragePerfTest StoragePerfTest.cpp PopulateTableRandom.cpp ScanTable.cpp)
if(NOT MSVC)
add_executable(ImportExportTest ImportExportTest.cpp)
endif()
add_executable(ArrowCsvForeignStorageTest ArrowCsvForeignStorageTest.cpp)
add_executable(AlterTableDdlTest AlterTableDdlTest.cpp)
add_executable(UpdelStorageTest UpdelStorageTest.cpp)
add_executable(ComputeMetadataTest ComputeMetadataTest.cpp)
add_executable(BumpAllocatorTest BumpAllocatorTest.cpp)
add_executable(SpecialCharsTest SpecialCharsTest.cpp)
add_executable(TableFunctionsTest TableFunctionsTest.cpp)
add_executable(ArrayTest ArrayTest.cpp)
add_executable(GroupByTest GroupByTest.cpp)
add_executable(ParallelExecutorsTest ParallelExecutorsTest.cpp)
add_executable(MigrationMgrTest MigrationMgrTest.cpp)
add_executable(TopKTest TopKTest.cpp)
add_executable(TokenCompletionHintsTest TokenCompletionHintsTest.cpp)
if(NOT MSVC)
add_executable(OmniSQLCommandTest OmniSQLCommandTest.cpp)
add_executable(OmniSQLUtilitiesTest OmniSQLUtilitiesTest.cpp)
endif()
add_executable(DBObjectPrivilegesTest DBObjectPrivilegesTest.cpp)
if(NOT MSVC)
add_executable(GeoTypesTest Geospatial/GeoTypesTest.cpp)
endif()
add_executable(OverlapsJoinTest OverlapsJoinTest.cpp)
if(NOT MSVC)
add_executable(CtasUpdateTest CtasUpdateTest.cpp)
endif()
add_executable(CorrelatedSubqueryTest CorrelatedSubqueryTest.cpp)
if(NOT MSVC)
add_executable(CtasIntegrationTest CtasIntegrationTest.cpp)
endif()
add_executable(DateTimeUtilsTest Shared/DateTimeUtilsTest.cpp)
add_executable(ThreadingTest Shared/ThreadingTest.cpp)
add_executable(ThreadingTestSTD Shared/ThreadingTest.cpp)
add_executable(UpdateMetadataTest UpdateMetadataTest.cpp)
add_executable(CalciteOptimizeTest CalciteOptimizeTest.cpp)
add_executable(JoinHashTableTest JoinHashTableTest.cpp)
add_executable(CachedHashTableTest CachedHashTableTest.cpp)
add_executable(RuntimeInterruptTest RuntimeInterruptTest.cpp)
add_executable(ColumnarResultsTest ColumnarResultsTest.cpp ResultSetTestUtils.cpp)
add_executable(CommandLineTest CommandLineTest.cpp)
add_executable(SQLHintTest SQLHintTest.cpp)
add_executable(LoadTableTest LoadTableTest.cpp)
if(NOT MSVC)
add_executable(QuantileCpuTest Quantile/QuantileCpuTest.cpp)
endif()
if(ENABLE_SYSTEM_TFS)
add_executable(SystemTableFunctionsTest SystemTableFunctionsTest.cpp)
if("${MAPD_EDITION_LOWER}" STREQUAL "ee")
if(ENABLE_RF_PROP_TFS)
add_executable(RFPropTableFunctionsTest ee/SystemTableFunctions/RFPropTableFunctionsTest.cpp)
endif()
endif()
endif()
if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
add_executable(UdfTest UdfTest.cpp)
endif()
if(ENABLE_CUDA)
add_executable(GpuSharedMemoryTest GpuSharedMemoryTest.cpp ResultSetTestUtils.cpp)
elseif(ENABLE_DBE)
add_executable(EmbeddedDatabaseTest EmbeddedDatabaseTest.cpp)
endif()
if(("${MAPD_EDITION_LOWER}" STREQUAL "ee") AND ENABLE_AWS_S3)
add_executable(UserMappingDdlTest ee/UserMappingDdlTest.cpp)
add_executable(PkiEncryptorTest ee/PkiEncryptorTest.cpp)
endif()
# Tests + Microbenchmarks
add_executable(TableUpdateDeleteBenchmark TableUpdateDeleteBenchmark.cpp)
add_executable(GeospatialBenchmark GeospatialBenchmark.cpp)
add_executable(StringDictionaryBenchmark StringDictionaryBenchmark.cpp)
set(EXECUTE_TEST_LIBS gtest mapd_thrift QueryRunner fmt::fmt ${MAPD_LIBRARIES} ${CMAKE_DL_LIBS} ${CUDA_LIBRARIES} ${Boost_LIBRARIES} ${ZLIB_LIBRARIES})
set(THRIFT_HANDLER_TEST_LIBRARIES thrift_handler ${EXECUTE_TEST_LIBS})
# Replace Licensing library with TestLicensing library
if("${MAPD_EDITION_LOWER}" STREQUAL "ee")
list(FIND THRIFT_HANDLER_TEST_LIBRARIES Licensing LICENSING_INDEX)
list(INSERT THRIFT_HANDLER_TEST_LIBRARIES ${LICENSING_INDEX} TestLicensing)
list(REMOVE_ITEM THRIFT_HANDLER_TEST_LIBRARIES Licensing)
endif()
target_link_libraries(ResultSetTest ${EXECUTE_TEST_LIBS})
target_link_libraries(ColumnarResultsTest ${EXECUTE_TEST_LIBS})
target_link_libraries(FromTableReorderingTest ${EXECUTE_TEST_LIBS})
target_link_libraries(ResultSetBaselineRadixSortTest ${EXECUTE_TEST_LIBS})
target_link_libraries(UtilTest Utils gtest Logger Shared ${Boost_LIBRARIES})
target_link_libraries(StringTransformTest Logger Shared gtest ${Boost_LIBRARIES})
target_link_libraries(StringFunctionsTest ${EXECUTE_TEST_LIBS})
target_link_libraries(TokenCompletionHintsTest token_completion_hints gtest mapd_thrift Logger Shared ${Boost_LIBRARIES})
target_link_libraries(DumpRestoreTest ${EXECUTE_TEST_LIBS})
target_link_libraries(CodeGeneratorTest ${EXECUTE_TEST_LIBS})
target_link_libraries(ExecuteTest ${EXECUTE_TEST_LIBS})
target_link_libraries(GeospatialTest ${EXECUTE_TEST_LIBS})
target_link_libraries(RunQueryLoop ${EXECUTE_TEST_LIBS} bcrypt)
target_link_libraries(ArrowCsvForeignStorageTest gtest ${EXECUTE_TEST_LIBS})
target_link_libraries(AlterTableDdlTest ${THRIFT_HANDLER_TEST_LIBRARIES})
target_link_libraries(UpdelStorageTest gtest ${EXECUTE_TEST_LIBS})
target_link_libraries(StorageTest gtest ${EXECUTE_TEST_LIBS})
target_link_libraries(ComputeMetadataTest ${THRIFT_HANDLER_TEST_LIBRARIES})
target_link_libraries(TableFunctionsTest ${EXECUTE_TEST_LIBS})
target_link_libraries(ArrayTest ${EXECUTE_TEST_LIBS})
target_link_libraries(ParallelExecutorsTest ${THRIFT_HANDLER_TEST_LIBRARIES})
target_link_libraries(GroupByTest ${EXECUTE_TEST_LIBS})
target_link_libraries(MigrationMgrTest ${EXECUTE_TEST_LIBS})
target_link_libraries(BumpAllocatorTest ${EXECUTE_TEST_LIBS})
target_link_libraries(SpecialCharsTest ${EXECUTE_TEST_LIBS})
target_link_libraries(UpdateMetadataTest ${EXECUTE_TEST_LIBS})
target_link_libraries(StoragePerfTest gtest ${EXECUTE_TEST_LIBS})
target_link_libraries(TopKTest ${EXECUTE_TEST_LIBS})
if(NOT MSVC)
target_link_libraries(OmniSQLCommandTest gtest ${Boost_LIBRARIES} mapd_thrift)
endif()
if(ENABLE_SYSTEM_TFS)
target_link_libraries(SystemTableFunctionsTest ${EXECUTE_TEST_LIBS})
if("${MAPD_EDITION_LOWER}" STREQUAL "ee")
if(ENABLE_RF_PROP_TFS)
target_link_libraries(RFPropTableFunctionsTest ${EXECUTE_TEST_LIBS})
endif()
endif()
endif()
if(ENABLE_KRB5)
if(NOT MSVC)
target_link_libraries(OmniSQLCommandTest krb5_gss Shared)
endif()
endif()
if(NOT MSVC)
target_link_libraries(OmniSQLUtilitiesTest gtest ${Boost_LIBRARIES})
endif()
if(ENABLE_FOLLY)
target_link_libraries(StringDictionaryTest gtest mapd_thrift StringDictionary Logger Utils $<$<AND:$<CXX_COMPILER_ID:GNU>,$<VERSION_LESS:$<CXX_COMPILER_VERSION>,9.0>>:stdc++fs> ${CMAKE_DL_LIBS} ${Folly_LIBRARIES} ${Boost_LIBRARIES} ${ZLIB_LIBRARIES})
else()
target_link_libraries(StringDictionaryTest gtest mapd_thrift StringDictionary Logger Utils $<$<AND:$<CXX_COMPILER_ID:GNU>,$<VERSION_LESS:$<CXX_COMPILER_VERSION>,9.0>>:stdc++fs> ${CMAKE_DL_LIBS} ${Boost_LIBRARIES} ${ZLIB_LIBRARIES})
endif()
if(NOT MSVC)
target_link_libraries(GeoTypesTest gtest Logger Shared Geospatial ${CMAKE_DL_LIBS})
endif()
target_link_libraries(OverlapsJoinTest ${EXECUTE_TEST_LIBS})
target_link_libraries(CorrelatedSubqueryTest ${EXECUTE_TEST_LIBS})
if(NOT MSVC)
target_link_libraries(CtasIntegrationTest gtest Logger Shared mapd_thrift ThriftClient ${LLVM_LINKER_FLAGS})
endif()
target_link_libraries(DateTimeUtilsTest gtest Logger Shared ${LLVM_LINKER_FLAGS})
target_link_libraries(ThreadingTest gtest Logger Shared ${LLVM_LINKER_FLAGS} ${TBB_LIBRARIES} ${CMAKE_DL_LIBS})
target_link_libraries(ThreadingTestSTD gtest Logger Shared ${LLVM_LINKER_FLAGS})
target_compile_options(ThreadingTestSTD PRIVATE -UENABLE_TBB -DENABLE_TBB=0)
target_link_libraries(CalciteOptimizeTest ${THRIFT_HANDLER_TEST_LIBRARIES})
target_link_libraries(JoinHashTableTest ${EXECUTE_TEST_LIBS})
target_link_libraries(CachedHashTableTest ${EXECUTE_TEST_LIBS})
target_link_libraries(RuntimeInterruptTest ${EXECUTE_TEST_LIBS})
target_link_libraries(UtilTest OSDependent)
target_link_libraries(EncoderTest gtest DataMgr Shared Logger)
target_link_libraries(CommandLineTest gtest Logger Shared ${Boost_LIBRARIES})
#Requires thrift_handler for DBHandler test fixture
if(NOT MSVC)
target_link_libraries(ImportExportTest gtest ${THRIFT_HANDLER_TEST_LIBRARIES})
target_link_libraries(CtasUpdateTest ${THRIFT_HANDLER_TEST_LIBRARIES})
endif()
target_link_libraries(DBObjectPrivilegesTest ${THRIFT_HANDLER_TEST_LIBRARIES})
target_link_libraries(ForeignServerDdlTest ${THRIFT_HANDLER_TEST_LIBRARIES})
target_link_libraries(CatalogMigrationTest ${THRIFT_HANDLER_TEST_LIBRARIES})
target_link_libraries(CreateAndDropTableDdlTest ${THRIFT_HANDLER_TEST_LIBRARIES})
target_link_libraries(ShowCommandsDdlTest ${THRIFT_HANDLER_TEST_LIBRARIES})
target_link_libraries(AlterSystemTest ${THRIFT_HANDLER_TEST_LIBRARIES})
target_link_libraries(ForeignTableDmlTest ${THRIFT_HANDLER_TEST_LIBRARIES})
target_link_libraries(DashboardAndCustomExpressionTest ${THRIFT_HANDLER_TEST_LIBRARIES})
target_link_libraries(FileMgrTest gtest DataMgr ${Boost_LIBRARIES})
target_link_libraries(FilePathWhitelistTest ${THRIFT_HANDLER_TEST_LIBRARIES})
target_link_libraries(SQLHintTest ${EXECUTE_TEST_LIBS})
if(NOT MSVC)
target_link_libraries(QuantileCpuTest gtest ${MAPD_LIBRARIES})
endif()
target_link_libraries(ForeignStorageCacheTest gtest ${MAPD_LIBRARIES})
target_link_libraries(PersistentStorageTest gtest ${MAPD_LIBRARIES})
target_link_libraries(ShardedTableEpochConsistencyTest ${THRIFT_HANDLER_TEST_LIBRARIES})
target_link_libraries(DiskCacheQueryTest ${THRIFT_HANDLER_TEST_LIBRARIES})
target_link_libraries(CachingFileMgrTest gtest DataMgr ${Boost_LIBRARIES})
target_link_libraries(LoadTableTest ${THRIFT_HANDLER_TEST_LIBRARIES})
target_link_libraries(DataRecyclerTest ${THRIFT_HANDLER_TEST_LIBRARIES})
if(NOT MSVC)
target_link_libraries(JSONTest gtest Logger Shared)
endif()
target_link_libraries(DataMgrTest DataMgr ${THRIFT_HANDLER_TEST_LIBRARIES})
if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
target_link_libraries(UdfTest gtest UdfCompiler ${EXECUTE_TEST_LIBS})
endif()
target_link_libraries(TableUpdateDeleteBenchmark benchmark ${EXECUTE_TEST_LIBS})
target_link_libraries(GeospatialBenchmark benchmark ${EXECUTE_TEST_LIBS})
if(ENABLE_FOLLY)
target_link_libraries(StringDictionaryBenchmark benchmark gtest mapd_thrift StringDictionary Logger Utils $<$<AND:$<CXX_COMPILER_ID:GNU>,$<VERSION_LESS:$<CXX_COMPILER_VERSION>,9.0>>:stdc++fs> ${CMAKE_DL_LIBS} ${Folly_LIBRARIES} ${Boost_LIBRARIES} ${ZLIB_LIBRARIES})
else()
target_link_libraries(StringDictionaryBenchmark benchmark gtest mapd_thrift StringDictionary Logger Utils $<$<AND:$<CXX_COMPILER_ID:GNU>,$<VERSION_LESS:$<CXX_COMPILER_VERSION>,9.0>>:stdc++fs> ${CMAKE_DL_LIBS} ${Boost_LIBRARIES} ${ZLIB_LIBRARIES})
endif()
if(ENABLE_CUDA)
target_link_libraries(GpuSharedMemoryTest ${EXECUTE_TEST_LIBS})
elseif(ENABLE_DBE)
target_link_libraries(EmbeddedDatabaseTest gtest DBEngine)
endif()
if("${MAPD_EDITION_LOWER}" STREQUAL "ee")
target_link_libraries(UserMappingDdlTest ${THRIFT_HANDLER_TEST_LIBRARIES})
target_link_libraries(PkiEncryptorTest gtest Logger Shared)
if(ENABLE_AWS_S3)
target_link_libraries(S3SelectClientTest ${EXECUTE_TEST_LIBS})
endif()
endif()
set(TEST_ARGS "--gtest_output=xml:../")
add_test(DumpRestoreTest DumpRestoreTest ${TEST_ARGS})
add_test(UpdelStorageTest UpdelStorageTest ${TEST_ARGS})
if(NOT MSVC)
add_test(ImportExportTest ImportExportTest ${TEST_ARGS})
endif()
add_test(ArrowCsvForeignStorageTest ArrowCsvForeignStorageTest ${TEST_ARGS})
add_test(AlterTableDdlTest AlterTableDdlTest ${TEST_ARGS})
add_test(UtilTest UtilTest ${TEST_ARGS})
add_test(ExecuteTest ExecuteTest ${TEST_ARGS})
add_test(NAME ExecuteTestTemporaryTables COMMAND ExecuteTest ${TEST_ARGS} "--use-temporary-tables")
add_test(GeospatialTest GeospatialTest ${TEST_ARGS})
add_test(CodeGeneratorTest CodeGeneratorTest ${TEST_ARGS})
add_test(ResultSetTest ResultSetTest ${TEST_ARGS})
add_test(ColumnarResultsTest ColumnarResultsTest ${TEST_ARGS})
add_test(FromTableReorderingTest FromTableReorderingTest ${TEST_ARGS})
add_test(JoinHashTableTest JoinHashTableTest ${TEST_ARGS})
add_test(CachedHashTableTest CachedHashTableTest ${TEST_ARGS})
add_test(ResultSetBaselineRadixSortTest ResultSetBaselineRadixSortTest ${TEST_ARGS})
add_test(RunQueryLoop RunQueryLoop ${TEST_ARGS})
add_test(StringDictionaryTest StringDictionaryTest ${TEST_ARGS})
add_test(NAME StringDictionaryHashTest COMMAND StringDictionaryTest ${TEST_ARGS} "--enable-string-dict-hash-cache")
add_test(StringTransformTest StringTransformTest ${TEST_ARGS})
add_test(StringFunctionsTest StringFunctionsTest ${TEST_ARGS})
add_test(StorageTest StorageTest ${TEST_ARGS})
add_test(ComputeMetadataTest ComputeMetadataTest ${TEST_ARGS})
add_test(BumpAllocatorTest BumpAllocatorTest ${TEST_ARGS})
add_test(SpecialCharsTest SpecialCharsTest ${TEST_ARGS})
add_test(TableFunctionsTest TableFunctionsTest ${TEST_ARGS})
add_test(ArrayTest ArrayTest ${TEST_ARGS})
add_test(ParallelExecutorsTest ParallelExecutorsTest ${TEST_ARGS})
add_test(GroupByTest GroupByTest ${TEST_ARGS})
add_test(MigrationMgrTest MigrationMgrTest ${TEST_ARGS})
add_test(StoragePerfTest StoragePerfTest ${TEST_ARGS})
add_test(TopKTest TopKTest ${TEST_ARGS})
add_test(TokenCompletionHintsTest TokenCompletionHintsTest ${TEST_ARGS})
if(NOT MSVC)
add_test(OmniSQLCommandTest OmniSQLCommandTest ${TEST_ARGS})
add_test(OmniSQLUtilitiesTest OmniSQLUtilitiesTest ${TEST_ARGS})
endif()
add_test(DBObjectPrivilegesTest DBObjectPrivilegesTest ${TEST_ARGS})
if(NOT MSVC)
add_test(GeoTypesTest GeoTypesTest ${TEST_ARGS})
endif()
add_test(OverlapsJoinTest OverlapsJoinTest ${TEST_ARGS})
if(NOT MSVC)
add_test(CtasUpdateTest CtasUpdateTest ${TEST_ARGS})
endif()
add_test(CorrelatedSubqueryTest CorrelatedSubqueryTest ${TEST_ARGS})
add_test(DateTimeUtilsTest DateTimeUtilsTest ${TEST_ARGS})
add_test(ThreadingTest ThreadingTest ${TEST_ARGS})
add_test(ThreadingTestSTD ThreadingTestSTD ${TEST_ARGS})
add_test(UpdateMetadataTest UpdateMetadataTest ${TEST_ARGS})
add_test(CalciteOptimizeTest CalciteOptimizeTest ${TEST_ARGS})
add_test(JoinHashTableTest JoinHashTableTest ${TEST_ARGS})
add_tesT(RuntimeInterruptTest RuntimeInterruptTest ${TEST_ARGS})
add_test(CommandLineTest CommandLineTest ${TEST_ARGS})
add_test(ForeignServerDdlTest ForeignServerDdlTest ${TEST_ARGS})
add_test(ShowCommandsDdlTest ShowCommandsDdlTest ${TEST_ARGS})
add_test(AlterSystemTest AlterSystemTest ${TEST_ARGS})
add_test(CatalogMigrationTest CatalogMigrationTest ${TEST_ARGS})
add_test(CreateAndDropTableDdlTest CreateAndDropTableDdlTest ${TEST_ARGS})
add_test(ForeignTableDmlTest ForeignTableDmlTest ${TEST_ARGS})
add_test(DashboardAndCustomExpressionTest DashboardAndCustomExpressionTest ${TEST_ARGS})
add_test(FileMgrTest FileMgrTest ${TEST_ARGS})
add_test(FilePathWhitelistTest FilePathWhitelistTest ${TEST_ARGS})
add_test(EncoderTest EncoderTest ${TEST_ARGS})
add_test(SQLHintTest SQLHintTest ${TEST_ARGS})
add_test(ForeignStorageCacheTest ForeignStorageCacheTest ${TEST_ARGS})
add_test(PersistentStorageTest PersistentStorageTest ${TEST_ARGS})
add_test(ShardedTableEpochConsistencyTest ShardedTableEpochConsistencyTest ${TEST_ARGS})
add_test(DiskCacheQueryTest DiskCacheQueryTest ${TEST_ARGS})
add_test(CachingFileMgrTest CachingFileMgrTest ${TEST_ARGS})
add_test(DataRecyclerTest DataRecyclerTest ${TEST_ARGS})
add_test(LoadTableTest LoadTableTest ${TEST_ARGS})
if(NOT MSVC)
add_test(JSONTest JSONTest ${TEST_ARGS})
endif()
add_test(DataMgrTest DataMgrTest ${TEST_ARGS})
if(ENABLE_SYSTEM_TFS)
add_test(SystemTableFunctionsTest SystemTableFunctionsTest ${TEST_ARGS})
if("${MAPD_EDITION_LOWER}" STREQUAL "ee")
if(ENABLE_RF_PROP_TFS)
add_test(RFPropTableFunctionsTest RFPropTableFunctionsTest ${TEST_ARGS})
endif()
endif()
endif()
if(ENABLE_CUDA)
add_test(GpuSharedMemoryTest GpuSharedMemoryTest ${TEST_ARGS})
elseif(ENABLE_DBE)
add_test(EmbeddedDatabaseTest EmbeddedDatabaseTest ${TEST_ARGS})
endif()
if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
add_test(UdfTest UdfTest ${TEST_ARGS})
endif()
if("${MAPD_EDITION_LOWER}" STREQUAL "ee")
add_test(UserMappingDdlTest UserMappingDdlTest ${TEST_ARGS})
add_test(PkiEncryptorTest PkiEncryptorTest ${TEST_ARGS})
if(ENABLE_AWS_S3)
add_test(S3SelectClientTest S3SelectClientTest ${TEST_ARGS})
endif()
endif()
find_package(fmt REQUIRED)
if(NOT MSVC)
add_executable(ArrowIpcIntegrationTest ArrowIpcIntegrationTest.cpp)
target_link_libraries(ArrowIpcIntegrationTest gtest fmt::fmt ThriftClient mapd_thrift Logger Shared ${CUDA_LIBRARIES} ${Arrow_LIBRARIES})
add_test(ArrowIpcIntegrationTest ArrowIpcIntegrationTest ${TEST_ARGS})
endif()
#parse s3 credentials
file(READ aws/s3client.conf S3CLIENT_CONF)
if("${S3CLIENT_CONF}" MATCHES "AWS_ACCESS_KEY_ID=([^\n]+)")
set(AWS_ACCESS_KEY_ID "${CMAKE_MATCH_1}")
endif()
if("${S3CLIENT_CONF}" MATCHES "AWS_SECRET_ACCESS_KEY=([^\n]+)")
set(AWS_SECRET_ACCESS_KEY "${CMAKE_MATCH_1}")
endif()
if("${S3CLIENT_CONF}" MATCHES "AWS_REGION=([^\n]+)")
set(AWS_REGION "${CMAKE_MATCH_1}")
endif()
set(TEST_PROGRAMS
DumpRestoreTest
ExecuteTest
GeospatialTest
CodeGeneratorTest
ResultSetTest
ColumnarResultsTest
FromTableReorderingTest
ResultSetBaselineRadixSortTest
StorageTest)
if(NOT MSVC)
list(APPEND TEST_PROGRAMS ImportExportTest)
endif()
list(APPEND TEST_PROGRAMS
ArrowCsvForeignStorageTest
AlterTableDdlTest
UpdelStorageTest
ComputeMetadataTest
BumpAllocatorTest
SpecialCharsTest
TableFunctionsTest
ArrayTest
GroupByTest
ParallelExecutorsTest
MigrationMgrTest
TopKTest
TokenCompletionHintsTest)
if(NOT MSVC)
list(APPEND TEST_PROGRAMS OmniSQLCommandTest OmniSQLUtilitiesTest)
endif()
list(APPEND TEST_PROGRAMS
DBObjectPrivilegesTest)
if(NOT MSVC)
list(APPEND TEST_PROGRAMS GeoTypesTest)
endif()
list(APPEND TEST_PROGRAMS
OverlapsJoinTest)
if(NOT MSVC)
list(APPEND TEST_PROGRAMS CtasUpdateTest)
endif()
list(APPEND TEST_PROGRAMS
CorrelatedSubqueryTest
DateTimeUtilsTest
ThreadingTest
ThreadingTestSTD
UpdateMetadataTest
CalciteOptimizeTest
JoinHashTableTest
CachedHashTableTest
RuntimeInterruptTest
StringFunctionsTest
StringDictionaryTest
CommandLineTest
ForeignServerDdlTest
ShowCommandsDdlTest
AlterSystemTest
CatalogMigrationTest
CreateAndDropTableDdlTest
ForeignTableDmlTest
DashboardAndCustomExpressionTest
FileMgrTest
FilePathWhitelistTest
EncoderTest
SQLHintTest
ForeignStorageCacheTest
PersistentStorageTest
ShardedTableEpochConsistencyTest
DataRecyclerTest
DiskCacheQueryTest
CachingFileMgrTest
LoadTableTest)
if(NOT MSVC)
list(APPEND TEST_PROGRAMS JSONTest)
endif()
list(APPEND TEST_PROGRAMS
DataMgrTest)
if(NOT MSVC)
list(APPEND TEST_PROGRAMS
JSONTest
ImportExportTest
GeoTypesTest
OmniSQLCommandTest
CtasUpdateTest
OmniSQLUtilitiesTest)
endif()
if (ENABLE_SYSTEM_TFS)
list(APPEND TEST_PROGRAMS SystemTableFunctionsTest)
if("${MAPD_EDITION_LOWER}" STREQUAL "ee")
if(ENABLE_RF_PROP_TFS)
list(APPEND TEST_PROGRAMS RFPropTableFunctionsTest)
endif()
endif()
endif()
if(ENABLE_CUDA)
list(APPEND TEST_PROGRAMS GpuSharedMemoryTest)
elseif(ENABLE_DBE)
list(APPEND TEST_PROGRAMS EmbeddedDatabaseTest)
endif()
if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
list(APPEND TEST_PROGRAMS UdfTest)
endif()
if("${MAPD_EDITION_LOWER}" STREQUAL "ee")
list(APPEND TEST_PROGRAMS UserMappingDdlTest)
list(APPEND TEST_PROGRAMS PkiEncryptorTest)
endif()
set(SANITY_TESTS ${TEST_PROGRAMS})
list(APPEND SANITY_TESTS ExecuteTestTemporaryTables)
list(APPEND SANITY_TESTS StringDictionaryHashTest)
set_tests_properties(${SANITY_TESTS} PROPERTIES LABELS "sanity")
add_custom_target(sanity_tests
COMMAND mkdir -p ${TEST_BASE_PATH}
COMMAND initdb -f ${TEST_BASE_PATH} || exit 0
COMMAND env AWS_REGION=${AWS_REGION}
AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
${CMAKE_CTEST_COMMAND} --verbose --label-regex sanity
DEPENDS ${TEST_PROGRAMS}
USES_TERMINAL)
add_custom_target(all_tests
COMMAND mkdir -p ${TEST_BASE_PATH}
COMMAND initdb -f ${TEST_BASE_PATH}
COMMAND env AWS_REGION=${AWS_REGION}
AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
${CMAKE_CTEST_COMMAND} --verbose
DEPENDS ${TEST_PROGRAMS} UtilTest RunQueryLoop StringDictionaryTest StringTransformTest StoragePerfTest
USES_TERMINAL)
add_custom_target(storage_perf_tests
COMMAND mkdir -p ${TEST_BASE_PATH}
COMMAND initdb -f ${TEST_BASE_PATH}
COMMAND ${CMAKE_CTEST_COMMAND} --verbose --tests-regex "\"(StoragePerfTest)\""
DEPENDS StoragePerfTest)
add_custom_target(topk_tests
COMMAND mkdir -p ${TEST_BASE_PATH}
COMMAND initdb -f ${TEST_BASE_PATH}
COMMAND ${CMAKE_CTEST_COMMAND} --verbose --tests-regex "\"(TopKTest)\""
DEPENDS TopKTest)
if(ENABLE_DBE)
set(DBE_TEST_PROGRAMS EmbeddedDatabaseTest)
set_tests_properties(${DBE_TEST_PROGRAMS} PROPERTIES LABELS "embedded")
add_custom_target(dbe_all_tests
COMMAND mkdir -p ${TEST_BASE_PATH}
COMMAND env AWS_REGION=${AWS_REGION}
AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
${CMAKE_CTEST_COMMAND} --verbose --label-regex embedded
DEPENDS DBEngine ${DBE_TEST_PROGRAMS}
USES_TERMINAL)
add_dependencies(dbe_all_tests dbe4py-test)
add_dependencies(all_tests dbe4py-test)
endif()
add_subdirectory(ExtensionFunctions/h3lib/)