-
Notifications
You must be signed in to change notification settings - Fork 449
/
Copy pathCMakeLists.txt
883 lines (655 loc) · 31.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
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
##########
########## Settings.
##########
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)
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()
find_package(fmt REQUIRED)
#set(EXECUTE_TEST_LIBS gtest mapd_thrift QueryRunner fmt::fmt ${MAPD_LIBRARIES} ${CMAKE_DL_LIBS} ${CUDA_LIBRARIES} ${Boost_LIBRARIES} ${ZLIB_LIBRARIES})
# If ENABLE_AWS_S3=off AwsS3_CURL_SUPPORT will be empty
set(EXECUTE_TEST_LIBS gtest mapd_thrift QueryRunner fmt::fmt ${MAPD_LIBRARIES}
${CMAKE_DL_LIBS} ${CUDA_LIBRARIES} ${Boost_LIBRARIES} ${ZLIB_LIBRARIES} ${AwsS3_CURL_SUPPORT})
set(THRIFT_HANDLER_TEST_LIBRARIES thrift_handler ${EXECUTE_TEST_LIBS})
#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_ARGS "--gtest_output=xml:../")
# Partition settings for the sanity_tests.
set(HEAVYAI_PARTITION 0 CACHE STRING "Partition number to build or zero to disable partitioning.")
set(HEAVYAI_MAX_PARTITION 4)
if(${HEAVYAI_PARTITION} LESS 0 OR ${HEAVYAI_PARTITION} GREATER ${HEAVYAI_MAX_PARTITION})
message(FATAL_ERROR "invalid HEAVYAI_PARTITION ${HEAVYAI_PARTITION}, expected 1-${HEAVYAI_MAX_PARTITION}, or 0 to disable")
endif()
if(${HEAVYAI_PARTITION} GREATER_EQUAL 1 AND ${HEAVYAI_PARTITION} LESS_EQUAL ${HEAVYAI_MAX_PARTITION})
message(STATUS "Building only sanity tests from partition: ${HEAVYAI_PARTITION} (of ${HEAVYAI_MAX_PARTITION})")
endif()
##########
########## Sanity tests (sanity_tests).
##########
if(${HEAVYAI_PARTITION} EQUAL 0 OR ${HEAVYAI_PARTITION} EQUAL 1) # Partition 1
##########
add_executable(AlterSystemTest AlterSystemTest.cpp)
target_link_libraries(AlterSystemTest ${THRIFT_HANDLER_TEST_LIBRARIES})
add_test(AlterSystemTest AlterSystemTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS AlterSystemTest)
##########
add_executable(AlterTableDdlTest AlterTableDdlTest.cpp)
target_link_libraries(AlterTableDdlTest ${THRIFT_HANDLER_TEST_LIBRARIES})
add_test(AlterTableDdlTest AlterTableDdlTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS AlterTableDdlTest)
##########
add_executable(ArrayTest ArrayTest.cpp)
target_link_libraries(ArrayTest ${EXECUTE_TEST_LIBS})
add_test(ArrayTest ArrayTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS ArrayTest)
##########
add_executable(ArrowCsvForeignStorageTest ArrowCsvForeignStorageTest.cpp)
target_link_libraries(ArrowCsvForeignStorageTest gtest ${EXECUTE_TEST_LIBS})
add_test(ArrowCsvForeignStorageTest ArrowCsvForeignStorageTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS ArrowCsvForeignStorageTest)
##########
add_executable(BufferMgrTest BufferMgrTest.cpp)
# CudaMgr constructor requires the dependency on QueryEngineCudaTargets and QueryEngine.
if(ENABLE_CUDA)
add_dependencies(BufferMgrTest QueryEngineCudaTargets)
endif()
target_link_libraries(BufferMgrTest gtest DataMgr QueryEngine)
add_test(BufferMgrTest BufferMgrTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS BufferMgrTest)
##########
add_executable(BumpAllocatorTest BumpAllocatorTest.cpp)
target_link_libraries(BumpAllocatorTest ${EXECUTE_TEST_LIBS})
add_test(BumpAllocatorTest BumpAllocatorTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS BumpAllocatorTest)
##########
add_executable(CachedHashTableTest CachedHashTableTest.cpp)
target_link_libraries(CachedHashTableTest ${EXECUTE_TEST_LIBS})
add_test(CachedHashTableTest CachedHashTableTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS CachedHashTableTest)
##########
add_executable(CachingFileMgrTest CachingFileMgrTest.cpp)
target_link_libraries(CachingFileMgrTest DataMgr ${EXECUTE_TEST_LIBS})
add_test(CachingFileMgrTest CachingFileMgrTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS CachingFileMgrTest)
##########
add_executable(CalciteOptimizeTest CalciteOptimizeTest.cpp)
target_link_libraries(CalciteOptimizeTest ${THRIFT_HANDLER_TEST_LIBRARIES})
add_test(CalciteOptimizeTest CalciteOptimizeTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS CalciteOptimizeTest)
##########
add_executable(CatalogMigrationTest CatalogMigrationTest.cpp)
target_link_libraries(CatalogMigrationTest ${THRIFT_HANDLER_TEST_LIBRARIES})
add_test(CatalogMigrationTest CatalogMigrationTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS CatalogMigrationTest)
##########
add_executable(CodeCacheTest CodeCacheTest.cpp)
target_link_libraries(CodeCacheTest ${THRIFT_HANDLER_TEST_LIBRARIES})
add_test(CodeCacheTest CodeCacheTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS CodeCacheTest)
##########
add_executable(CodeGeneratorTest CodeGeneratorTest.cpp)
target_link_libraries(CodeGeneratorTest ${EXECUTE_TEST_LIBS} ${LibAwsS3_LIBRARIES})
add_test(CodeGeneratorTest CodeGeneratorTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS CodeGeneratorTest)
##########
add_executable(ColumnarResultsTest ColumnarResultsTest.cpp ResultSetTestUtils.cpp)
target_link_libraries(ColumnarResultsTest ${EXECUTE_TEST_LIBS} ${LibAwsS3_LIBRARIES})
add_test(ColumnarResultsTest ColumnarResultsTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS ColumnarResultsTest)
##########
add_executable(CommandLineTest CommandLineTest.cpp)
target_link_libraries(CommandLineTest gtest Logger Shared ${Boost_LIBRARIES})
add_test(CommandLineTest CommandLineTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS CommandLineTest)
##########
add_executable(ComputeMetadataTest ComputeMetadataTest.cpp)
target_link_libraries(ComputeMetadataTest ${THRIFT_HANDLER_TEST_LIBRARIES})
add_test(ComputeMetadataTest ComputeMetadataTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS ComputeMetadataTest)
##########
add_executable(ConcurrencyTest ConcurrencyTest.cpp)
target_link_libraries(ConcurrencyTest ${THRIFT_HANDLER_TEST_LIBRARIES})
add_test(ConcurrencyTest ConcurrencyTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS ConcurrencyTest)
##########
add_executable(CorrelatedSubqueryTest CorrelatedSubqueryTest.cpp)
target_link_libraries(CorrelatedSubqueryTest ${EXECUTE_TEST_LIBS})
add_test(CorrelatedSubqueryTest CorrelatedSubqueryTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS CorrelatedSubqueryTest)
##########
add_executable(CreateAndDropTableDdlTest CreateAndDropTableDdlTest.cpp)
target_link_libraries(CreateAndDropTableDdlTest ${THRIFT_HANDLER_TEST_LIBRARIES})
add_test(CreateAndDropTableDdlTest CreateAndDropTableDdlTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS CreateAndDropTableDdlTest)
##########
add_executable(CrossDatabaseQueryTest CrossDatabaseQueryTest.cpp)
target_link_libraries(CrossDatabaseQueryTest ${THRIFT_HANDLER_TEST_LIBRARIES})
add_test(CrossDatabaseQueryTest CrossDatabaseQueryTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS CrossDatabaseQueryTest)
##########
if(NOT MSVC)
add_executable(CtasUpdateTest CtasUpdateTest.cpp)
target_link_libraries(CtasUpdateTest ${THRIFT_HANDLER_TEST_LIBRARIES})
add_test(CtasUpdateTest CtasUpdateTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS CtasUpdateTest)
endif()
##########
add_executable(DashboardAndCustomExpressionTest DashboardAndCustomExpressionTest.cpp)
target_link_libraries(DashboardAndCustomExpressionTest ${THRIFT_HANDLER_TEST_LIBRARIES})
add_test(DashboardAndCustomExpressionTest DashboardAndCustomExpressionTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS DashboardAndCustomExpressionTest)
##########
add_executable(DataMgrTest DataMgrTest.cpp)
target_link_libraries(DataMgrTest DataMgr ${THRIFT_HANDLER_TEST_LIBRARIES})
add_test(DataMgrTest DataMgrTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS DataMgrTest)
##########
add_executable(DataRecyclerTest DataRecyclerTest.cpp)
target_link_libraries(DataRecyclerTest ${THRIFT_HANDLER_TEST_LIBRARIES})
add_test(DataRecyclerTest DataRecyclerTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS DataRecyclerTest)
##########
add_executable(DateTimeUtilsTest Shared/DateTimeUtilsTest.cpp)
target_link_libraries(DateTimeUtilsTest gtest Logger Shared ${LLVM_LINKER_FLAGS})
add_test(DateTimeUtilsTest DateTimeUtilsTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS DateTimeUtilsTest)
##########
add_executable(DBObjectPrivilegesTest DBObjectPrivilegesTest.cpp)
target_link_libraries(DBObjectPrivilegesTest ${THRIFT_HANDLER_TEST_LIBRARIES})
add_test(DBObjectPrivilegesTest DBObjectPrivilegesTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS DBObjectPrivilegesTest)
##########
add_executable(DiskCacheQueryTest DiskCacheQueryTest.cpp)
target_link_libraries(DiskCacheQueryTest ${THRIFT_HANDLER_TEST_LIBRARIES})
add_test(DiskCacheQueryTest DiskCacheQueryTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS DiskCacheQueryTest)
##########
add_executable(DumpRestoreTest DumpRestoreTest.cpp)
target_link_libraries(DumpRestoreTest ${EXECUTE_TEST_LIBS})
add_test(DumpRestoreTest DumpRestoreTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS DumpRestoreTest)
##########
if(NOT ENABLE_CUDA AND ENABLE_DBE)
add_executable(EmbeddedDatabaseTest EmbeddedDatabaseTest.cpp)
target_link_libraries(EmbeddedDatabaseTest gtest DBEngine)
add_test(EmbeddedDatabaseTest EmbeddedDatabaseTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS EmbeddedDatabaseTest)
endif()
##########
add_executable(EncoderTest EncoderTest.cpp)
target_link_libraries(EncoderTest gtest DataMgr Shared Logger)
add_test(EncoderTest EncoderTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS EncoderTest)
##########
endif() # Partition 1
if(${HEAVYAI_PARTITION} EQUAL 0 OR ${HEAVYAI_PARTITION} EQUAL 2) # Partition 2
##########
add_executable(ExecuteTest ExecuteTest.cpp ClusterTester.cpp)
target_link_libraries(ExecuteTest ${EXECUTE_TEST_LIBS})
add_test(ExecuteTest ExecuteTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS ExecuteTest)
add_test(NAME ExecuteTestTemporaryTables COMMAND ExecuteTest ${TEST_ARGS} "--use-temporary-tables")
add_test(NAME ExecuteTestExecutorResourceMgr COMMAND ExecuteTest ${TEST_ARGS} "--enable-executor-resource-mgr")
list(APPEND INSANITY_TEST_PROGRAMS ExecuteTest)
list(APPEND INSANITY_TESTS ExecuteTestTemporaryTables)
list(APPEND INSANITY_TESTS ExecuteTestExecutorResourceMgr)
##########
endif() # Partition 2
if(${HEAVYAI_PARTITION} EQUAL 0 OR ${HEAVYAI_PARTITION} EQUAL 3) # Partition 3
##########
add_executable(ExecutorResourceMgrTest ExecutorResourceMgrTest.cpp)
target_link_libraries(ExecutorResourceMgrTest ${EXECUTE_TEST_LIBS})
add_test(ExecutorResourceMgrTest ExecutorResourceMgrTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS ExecutorResourceMgrTest)
##########
add_executable(ExplainTest ExplainTest.cpp)
target_link_libraries(ExplainTest ${THRIFT_HANDLER_TEST_LIBRARIES})
add_test(ExplainTest ExplainTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS ExplainTest)
##########
add_executable(FileMgrTest FileMgrTest.cpp)
target_link_libraries(FileMgrTest DataMgr ${EXECUTE_TEST_LIBS})
add_test(FileMgrTest FileMgrTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS FileMgrTest)
##########
add_executable(FilePathWhitelistTest FilePathWhitelistTest.cpp)
target_link_libraries(FilePathWhitelistTest ${THRIFT_HANDLER_TEST_LIBRARIES})
add_test(FilePathWhitelistTest FilePathWhitelistTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS FilePathWhitelistTest)
##########
add_executable(ForeignServerDdlTest ForeignServerDdlTest.cpp)
target_link_libraries(ForeignServerDdlTest ${THRIFT_HANDLER_TEST_LIBRARIES})
add_test(ForeignServerDdlTest ForeignServerDdlTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS ForeignServerDdlTest)
##########
add_executable(ForeignStorageCacheTest ForeignStorageCacheTest.cpp)
target_link_libraries(ForeignStorageCacheTest gtest ${MAPD_LIBRARIES} ${AwsS3_CURL_SUPPORT})
add_test(ForeignStorageCacheTest ForeignStorageCacheTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS ForeignStorageCacheTest)
##########
add_executable(ForeignTableDmlTest ForeignTableDmlTest.cpp)
target_link_libraries(ForeignTableDmlTest ${THRIFT_HANDLER_TEST_LIBRARIES})
add_test(ForeignTableDmlTest ForeignTableDmlTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS ForeignTableDmlTest)
##########
add_executable(FromTableReorderingTest FromTableReorderingTest.cpp)
target_link_libraries(FromTableReorderingTest ${EXECUTE_TEST_LIBS} ${LibAwsS3_LIBRARIES})
add_test(FromTableReorderingTest FromTableReorderingTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS FromTableReorderingTest)
##########
add_executable(GeospatialTest GeospatialTest.cpp)
target_link_libraries(GeospatialTest ${EXECUTE_TEST_LIBS})
add_test(GeospatialTest GeospatialTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS GeospatialTest)
##########
if(NOT MSVC)
add_executable(GeoTypesTest Geospatial/GeoTypesTest.cpp)
target_link_libraries(GeoTypesTest gtest Logger Shared Geospatial ${CMAKE_DL_LIBS} ${LibAwsS3_LIBRARIES})
add_test(GeoTypesTest GeoTypesTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS GeoTypesTest)
endif()
##########
if(ENABLE_CUDA)
add_executable(GpuSharedMemoryTest GpuSharedMemoryTest.cpp ResultSetTestUtils.cpp)
target_link_libraries(GpuSharedMemoryTest ${EXECUTE_TEST_LIBS})
add_test(GpuSharedMemoryTest GpuSharedMemoryTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS GpuSharedMemoryTest)
endif()
##########
add_executable(GroupByTest GroupByTest.cpp)
target_link_libraries(GroupByTest ${EXECUTE_TEST_LIBS})
add_test(GroupByTest GroupByTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS GroupByTest)
##########
if(NOT MSVC)
add_executable(ImportExportTest ImportExportTest.cpp)
target_link_libraries(ImportExportTest gtest ${THRIFT_HANDLER_TEST_LIBRARIES})
add_test(ImportExportTest ImportExportTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS ImportExportTest)
endif()
##########
add_executable(JoinHashTableTest JoinHashTableTest.cpp)
target_link_libraries(JoinHashTableTest ${EXECUTE_TEST_LIBS})
add_test(JoinHashTableTest JoinHashTableTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS JoinHashTableTest)
##########
if(NOT MSVC)
add_executable(JSONTest JSONTest.cpp)
target_link_libraries(JSONTest gtest Logger Shared)
add_test(JSONTest JSONTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS JSONTest)
endif()
##########
add_executable(LoadTableTest LoadTableTest.cpp)
target_link_libraries(LoadTableTest ${THRIFT_HANDLER_TEST_LIBRARIES})
add_test(LoadTableTest LoadTableTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS LoadTableTest)
##########
add_executable(MigrationMgrTest MigrationMgrTest.cpp)
target_link_libraries(MigrationMgrTest ${THRIFT_HANDLER_TEST_LIBRARIES})
add_test(MigrationMgrTest MigrationMgrTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS MigrationMgrTest)
##########
if(ENABLE_SYSTEM_TFS)
if (ENABLE_ML_ONEDAL_TFS OR ENABLE_ML_MLPACK_TFS)
add_executable(MLFunctionsTest MLFunctionsTest.cpp)
target_link_libraries(MLFunctionsTest ${EXECUTE_TEST_LIBS})
add_test(MLFunctionsTest MLFunctionsTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS MLFunctionsTest)
endif()
endif()
##########
if(ENABLE_SYSTEM_TFS)
if (ENABLE_TORCH_TFS)
add_executable(TorchTableFunctionsTest TorchTableFunctionsTest.cpp)
add_dependencies(TorchTableFunctionsTest TorchTableFunctions TestRuntimeLib RuntimeLibTestTableFunctions)
target_link_libraries(TorchTableFunctionsTest ${EXECUTE_TEST_LIBS})
add_test(TorchTableFunctionsTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS TorchTableFunctionsTest)
endif()
endif()
##########
if(NOT MSVC)
add_executable(OmniSQLCommandTest OmniSQLCommandTest.cpp)
target_link_libraries(OmniSQLCommandTest gtest ${Boost_LIBRARIES} mapd_thrift)
if(ENABLE_KRB5)
target_link_libraries(OmniSQLCommandTest krb5_gss Shared)
endif()
add_test(OmniSQLCommandTest OmniSQLCommandTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS OmniSQLCommandTest)
endif()
##########
if(NOT MSVC)
add_executable(OmniSQLUtilitiesTest OmniSQLUtilitiesTest.cpp)
target_link_libraries(OmniSQLUtilitiesTest gtest ${Boost_LIBRARIES})
add_test(OmniSQLUtilitiesTest OmniSQLUtilitiesTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS OmniSQLUtilitiesTest)
endif()
##########
endif() # Partition 3
if(${HEAVYAI_PARTITION} EQUAL 0 OR ${HEAVYAI_PARTITION} EQUAL 4) # Partition 4
##########
add_executable(OverlapsJoinTest GeospatialJoinTest.cpp)
target_link_libraries(OverlapsJoinTest ${EXECUTE_TEST_LIBS})
add_test(OverlapsJoinTest OverlapsJoinTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS OverlapsJoinTest)
##########
add_executable(ParallelExecutorsTest ParallelExecutorsTest.cpp)
target_link_libraries(ParallelExecutorsTest ${THRIFT_HANDLER_TEST_LIBRARIES})
add_test(ParallelExecutorsTest ParallelExecutorsTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS ParallelExecutorsTest)
add_test(NAME ParallelExecutorsResourceMgrTest COMMAND ParallelExecutorsTest ${TEST_ARGS} "--enable-executor-resource-mgr")
list(APPEND SANITY_TESTS ParallelExecutorsResourceMgrTest)
##########
add_executable(PersistentStorageTest PersistentStorageTest.cpp)
target_link_libraries(PersistentStorageTest gtest ${MAPD_LIBRARIES} ${CURL_LIBRARY})
add_test(PersistentStorageTest PersistentStorageTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS PersistentStorageTest)
##########
if("${MAPD_EDITION_LOWER}" STREQUAL "ee")
add_executable(PkiEncryptorTest ee/PkiEncryptorTest.cpp)
target_link_libraries(PkiEncryptorTest gtest Logger Shared)
add_test(PkiEncryptorTest PkiEncryptorTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS PkiEncryptorTest)
endif()
##########
add_executable(ReadOnlyTest ReadOnlyTest.cpp)
target_link_libraries(ReadOnlyTest ${THRIFT_HANDLER_TEST_LIBRARIES})
add_test(ReadOnlyTest ReadOnlyTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS ReadOnlyTest)
##########
add_executable(ResultSetBaselineRadixSortTest ResultSetBaselineRadixSortTest.cpp ResultSetTestUtils.cpp)
target_link_libraries(ResultSetBaselineRadixSortTest ${EXECUTE_TEST_LIBS} ${LibAwsS3_LIBRARIES})
#target_link_libraries(ResultSetBaselineRadixSortTest gtest ${MAPD_LIBRARIES} ${AwsS3_CURL_SUPPORT})
add_test(ResultSetBaselineRadixSortTest ResultSetBaselineRadixSortTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS ResultSetBaselineRadixSortTest)
##########
add_executable(ResultSetTest ResultSetTest.cpp ResultSetTestUtils.cpp)
target_link_libraries(ResultSetTest ${EXECUTE_TEST_LIBS})
add_test(ResultSetTest ResultSetTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS ResultSetTest)
##########
if(ENABLE_SYSTEM_TFS)
if("${MAPD_EDITION_LOWER}" STREQUAL "ee")
if(ENABLE_RF_PROP_TFS)
add_executable(RFPropTableFunctionsTest ee/SystemTableFunctions/RFPropTableFunctionsTest.cpp)
target_link_libraries(RFPropTableFunctionsTest ${EXECUTE_TEST_LIBS})
add_test(RFPropTableFunctionsTest RFPropTableFunctionsTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS RFPropTableFunctionsTest)
endif()
endif()
endif()
##########
add_executable(RuntimeInterruptTest RuntimeInterruptTest.cpp)
target_link_libraries(RuntimeInterruptTest ${EXECUTE_TEST_LIBS})
add_test(RuntimeInterruptTest RuntimeInterruptTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS RuntimeInterruptTest)
##########
add_executable(ShardedTableEpochConsistencyTest ShardedTableEpochConsistencyTest.cpp)
target_link_libraries(ShardedTableEpochConsistencyTest ${THRIFT_HANDLER_TEST_LIBRARIES})
add_test(ShardedTableEpochConsistencyTest ShardedTableEpochConsistencyTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS ShardedTableEpochConsistencyTest)
##########
add_executable(ShowCommandsDdlTest ShowCommandsDdlTest.cpp)
target_link_libraries(ShowCommandsDdlTest ${THRIFT_HANDLER_TEST_LIBRARIES})
add_test(ShowCommandsDdlTest ShowCommandsDdlTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS ShowCommandsDdlTest)
##########
add_executable(SQLHintTest SQLHintTest.cpp)
target_link_libraries(SQLHintTest ${EXECUTE_TEST_LIBS})
add_test(SQLHintTest SQLHintTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS SQLHintTest)
##########
add_executable(SpecialCharsTest SpecialCharsTest.cpp)
target_link_libraries(SpecialCharsTest ${EXECUTE_TEST_LIBS})
add_test(SpecialCharsTest SpecialCharsTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS SpecialCharsTest)
##########
add_executable(StorageTest StorageTest.cpp PopulateTableRandom.cpp ScanTable.cpp)
target_link_libraries(StorageTest gtest ${EXECUTE_TEST_LIBS})
add_test(StorageTest StorageTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS StorageTest)
##########
add_executable(StringDictionaryTest StringDictionaryTest.cpp)
if(ENABLE_FOLLY)
target_link_libraries(StringDictionaryTest gtest mapd_thrift StringDictionary
StringOps Logger Utils
$<$<AND:$<CXX_COMPILER_ID:GNU>,$<VERSION_LESS:$<CXX_COMPILER_VERSION>,9.0>>:stdc++fs>
${Folly_LIBRARIES} ${Boost_LIBRARIES} ${ZLIB_LIBRARIES}
${AwsS3_CURL_SUPPORT} ${CMAKE_DL_LIBS})
else()
target_link_libraries(StringDictionaryTest gtest mapd_thrift StringDictionary
StringOps Logger Utils
$<$<AND:$<CXX_COMPILER_ID:GNU>,$<VERSION_LESS:$<CXX_COMPILER_VERSION>,9.0>>:stdc++fs>
${Boost_LIBRARIES} ${ZLIB_LIBRARIES} ${AwsS3_CURL_SUPPORT} ${CMAKE_DL_LIBS})
endif()
if(ENABLE_TSAN)
add_test(StringDictionaryTest StringDictionaryTest ${TEST_ARGS} "--string-dictionary-size=10000")
else()
add_test(StringDictionaryTest StringDictionaryTest ${TEST_ARGS})
endif()
list(APPEND SANITY_TEST_PROGRAMS StringDictionaryTest)
if(ENABLE_TSAN)
add_test(NAME StringDictionaryHashTest COMMAND StringDictionaryTest ${TEST_ARGS} "--enable-string-dict-hash-cache" "--string-dictionary-size=10000")
else()
add_test(NAME StringDictionaryHashTest COMMAND StringDictionaryTest ${TEST_ARGS} "--enable-string-dict-hash-cache")
endif()
list(APPEND SANITY_TESTS StringDictionaryHashTest)
##########
add_executable(StringFunctionsTest StringFunctionsTest.cpp)
target_link_libraries(StringFunctionsTest ${EXECUTE_TEST_LIBS})
add_test(StringFunctionsTest StringFunctionsTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS StringFunctionsTest)
##########
if(ENABLE_SYSTEM_TFS)
add_executable(SystemTableFunctionsTest SystemTableFunctionsTest.cpp)
target_link_libraries(SystemTableFunctionsTest ${EXECUTE_TEST_LIBS})
add_test(SystemTableFunctionsTest SystemTableFunctionsTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS SystemTableFunctionsTest)
endif()
##########
add_executable(TableFunctionsTest TableFunctionsTest.cpp)
if(ENABLE_RUNTIME_LIBS)
add_dependencies(TableFunctionsTest TestRuntimeLib RuntimeLibTestTableFunctions)
endif()
target_link_libraries(TableFunctionsTest ${EXECUTE_TEST_LIBS})
add_test(TableFunctionsTest TableFunctionsTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS TableFunctionsTest)
##########
add_executable(ThreadingTest Shared/ThreadingTest.cpp)
target_link_libraries(ThreadingTest ${CMAKE_DL_LIBS} gtest Logger Shared ${LLVM_LINKER_FLAGS} ${TBB_LIBRARIES})
add_test(ThreadingTest ThreadingTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS ThreadingTest)
##########
add_executable(ThreadingTestSTD Shared/ThreadingTest.cpp)
target_compile_options(ThreadingTestSTD PRIVATE -UENABLE_TBB -DENABLE_TBB=0)
target_link_libraries(ThreadingTestSTD gtest Logger Shared ${LLVM_LINKER_FLAGS} ${CMAKE_DL_LIBS})
add_test(ThreadingTestSTD ThreadingTestSTD ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS ThreadingTestSTD)
##########
add_executable(TokenCompletionHintsTest TokenCompletionHintsTest.cpp)
target_link_libraries(TokenCompletionHintsTest token_completion_hints gtest mapd_thrift Logger Shared ${Boost_LIBRARIES} ${CMAKE_DL_LIBS})
add_test(TokenCompletionHintsTest TokenCompletionHintsTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS TokenCompletionHintsTest)
##########
add_executable(TopKTest TopKTest.cpp)
target_link_libraries(TopKTest ${EXECUTE_TEST_LIBS})
add_test(TopKTest TopKTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS TopKTest)
##########
if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
add_executable(UdfTest UdfTest.cpp)
target_link_libraries(UdfTest gtest UdfCompiler ${EXECUTE_TEST_LIBS})
add_test(UdfTest UdfTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS UdfTest)
endif()
##########
add_executable(UpdateMetadataTest UpdateMetadataTest.cpp)
target_link_libraries(UpdateMetadataTest ${EXECUTE_TEST_LIBS})
add_test(UpdateMetadataTest UpdateMetadataTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS UpdateMetadataTest)
##########
add_executable(UpdelStorageTest UpdelStorageTest.cpp)
target_link_libraries(UpdelStorageTest gtest ${EXECUTE_TEST_LIBS})
add_test(UpdelStorageTest UpdelStorageTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS UpdelStorageTest)
##########
if("${MAPD_EDITION_LOWER}" STREQUAL "ee")
add_executable(UserMappingDdlTest ee/UserMappingDdlTest.cpp)
target_link_libraries(UserMappingDdlTest ${THRIFT_HANDLER_TEST_LIBRARIES})
add_test(UserMappingDdlTest UserMappingDdlTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS UserMappingDdlTest)
endif()
##########
add_executable(SessionsStoreTest SessionsStoreTest.cpp)
target_link_libraries(SessionsStoreTest ${THRIFT_HANDLER_TEST_LIBRARIES})
add_test(SessionsStoreTest SessionsStoreTest ${TEST_ARGS})
list(APPEND SANITY_TEST_PROGRAMS SessionsStoreTest)
##########
endif() # Partition 4
##########
########## Other tests (non-sanity_tests).
##########
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()
##########
if(NOT MSVC)
add_executable(CtasIntegrationTest CtasIntegrationTest.cpp)
target_link_libraries(CtasIntegrationTest gtest Logger Shared mapd_thrift ThriftClient ${LLVM_LINKER_FLAGS})
endif()
##########
if("${MAPD_EDITION_LOWER}" STREQUAL "ee")
add_executable(MultiInstanceTest ee/MultiInstanceTest.cpp)
target_link_libraries(MultiInstanceTest gtest ${MAPD_LIBRARIES} ${CURL_LIBRARIES})
add_dependencies(MultiInstanceTest thrift_gen)
add_dependencies(MultiInstanceTest heavydb) # test invokes heavydb bin directly
add_dependencies(MultiInstanceTest mapd_java_components)
add_test(MultiInstanceTest, MultiInstanceTest ${TEST_ARGS})
endif()
##########
add_executable(GeospatialBenchmark GeospatialBenchmark.cpp)
target_link_libraries(GeospatialBenchmark benchmark ${EXECUTE_TEST_LIBS})
##########
if(NOT MSVC)
add_executable(QuantileCpuTest Quantile/QuantileCpuTest.cpp)
target_link_libraries(QuantileCpuTest gtest ${MAPD_LIBRARIES})
endif()
##########
add_executable(RunQueryLoop RunQueryLoop.cpp)
target_link_libraries(RunQueryLoop ${EXECUTE_TEST_LIBS} rg3_bcrypt)
add_test(RunQueryLoop RunQueryLoop ${TEST_ARGS})
##########
if("${MAPD_EDITION_LOWER}" STREQUAL "ee" AND ENABLE_AWS_S3)
add_executable(S3SelectClientTest ee/S3SelectClientTest.cpp)
target_link_libraries(S3SelectClientTest ${EXECUTE_TEST_LIBS})
add_test(S3SelectClientTest S3SelectClientTest ${TEST_ARGS})
endif()
##########
add_executable(StoragePerfTest StoragePerfTest.cpp PopulateTableRandom.cpp ScanTable.cpp)
target_link_libraries(StoragePerfTest gtest ${EXECUTE_TEST_LIBS})
add_test(StoragePerfTest StoragePerfTest ${TEST_ARGS})
##########
add_executable(StringDictionaryBenchmark StringDictionaryBenchmark.cpp)
if(ENABLE_FOLLY)
target_link_libraries(StringDictionaryBenchmark benchmark gtest mapd_thrift StringDictionary StringOps Logger Utils $<$<AND:$<CXX_COMPILER_ID:GNU>,$<VERSION_LESS:$<CXX_COMPILER_VERSION>,9.0>>:stdc++fs> ${Folly_LIBRARIES} ${Boost_LIBRARIES} ${ZLIB_LIBRARIES})
else()
target_link_libraries(StringDictionaryBenchmark benchmark gtest mapd_thrift StringDictionary StringOps Logger Utils $<$<AND:$<CXX_COMPILER_ID:GNU>,$<VERSION_LESS:$<CXX_COMPILER_VERSION>,9.0>>:stdc++fs> ${Boost_LIBRARIES} ${ZLIB_LIBRARIES})
endif()
##########
add_executable(StringTransformTest StringTransformTest.cpp)
target_link_libraries(StringTransformTest Logger Shared gtest ${Boost_LIBRARIES})
add_test(StringTransformTest StringTransformTest ${TEST_ARGS})
##########
add_executable(TableUpdateDeleteBenchmark TableUpdateDeleteBenchmark.cpp)
target_link_libraries(TableUpdateDeleteBenchmark benchmark ${EXECUTE_TEST_LIBS})
##########
add_executable(OneDALBenchmark OneDALBenchmark.cpp)
target_link_libraries(OneDALBenchmark benchmark ${EXECUTE_TEST_LIBS})
##########
add_executable(UtilTest UtilTest.cpp)
target_link_libraries(UtilTest Utils gtest Logger Shared ${Boost_LIBRARIES} OSDependent)
add_test(UtilTest UtilTest ${TEST_ARGS})
##########
########## Build targets.
##########
add_custom_target(clean-unit-tests-tmp-dir
COMMAND rm -rf ${TEST_BASE_PATH}
USES_TERMINAL)
add_dependencies(clean-all clean-unit-tests-tmp-dir)
add_custom_target(init_test_dir
COMMAND mkdir -p ${TEST_BASE_PATH}
COMMAND initheavy -f ${TEST_BASE_PATH} || exit 0
USES_TERMINAL)
if (ENABLE_INIT_DIR)
foreach(PROGRAM ${SANITY_TEST_PROGRAMS} ${INSANITY_TEST_PROGRAMS})
add_dependencies(${PROGRAM} init_test_dir)
endforeach()
endif()
list(APPEND SANITY_TESTS ${SANITY_TEST_PROGRAMS})
set_tests_properties(${SANITY_TESTS} PROPERTIES LABELS "_sanity_")
add_custom_target(sanity_tests_build_only DEPENDS init_test_dir ${SANITY_TEST_PROGRAMS})
add_custom_target(sanity_tests
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 init_test_dir ${SANITY_TEST_PROGRAMS}
USES_TERMINAL)
if(${HEAVYAI_PARTITION} EQUAL 0 OR ${HEAVYAI_PARTITION} EQUAL 1) # Partition 1
# list(APPEND INSANITY_TESTS ${INSANITY_TEST_PROGRAMS})
set_tests_properties(${INSANITY_TESTS} PROPERTIES LABELS "_insanity_")
add_custom_target(insanity_tests
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_|_insanity_\""
DEPENDS init_test_dir ${SANITY_TEST_PROGRAMS} ${INSANITY_TEST_PROGRAMS}
USES_TERMINAL)
endif() # Partition 1
add_custom_target(all_tests
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 init_test_dir ${SANITY_TEST_PROGRAMS} ${INSANITY_TEST_PROGRAMS} UtilTest RunQueryLoop StringDictionaryTest StringTransformTest StoragePerfTest
USES_TERMINAL)
add_custom_target(storage_perf_tests
COMMAND ${CMAKE_CTEST_COMMAND} --verbose --tests-regex "\"(StoragePerfTest)\""
DEPENDS init_test_dir StoragePerfTest)
add_custom_target(topk_tests
COMMAND ${CMAKE_CTEST_COMMAND} --verbose --tests-regex "\"(TopKTest)\""
DEPENDS init_test_dir 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 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 init_test_dir DBEngine ${DBE_TEST_PROGRAMS}
USES_TERMINAL)
add_dependencies(dbe_all_tests dbe4py-test)
add_dependencies(all_tests dbe4py-test)
endif()
add_subdirectory(ExtensionFunctions/h3lib/)