-
Notifications
You must be signed in to change notification settings - Fork 101
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
241 lines (211 loc) · 8.19 KB
/
CMakeLists.txt
File metadata and controls
241 lines (211 loc) · 8.19 KB
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
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
fetchcontent_declare(googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG b514bdc898e2951020cbdca1304b75f5950d1f59 # release-1.15.2
FIND_PACKAGE_ARGS
NAMES
GTest)
fetchcontent_makeavailable(googletest)
set(ICEBERG_TEST_RESOURCES "${CMAKE_SOURCE_DIR}/src/iceberg/test/resources")
configure_file("test_config.h.in" "test_config.h")
function(add_iceberg_test test_name)
set(options USE_BUNDLE)
set(oneValueArgs)
set(multiValueArgs SOURCES)
cmake_parse_arguments(ARG
"${options}"
"${oneValueArgs}"
"${multiValueArgs}"
${ARGN})
add_executable(${test_name})
target_include_directories(${test_name} PRIVATE "${CMAKE_BINARY_DIR}/iceberg/test/")
target_sources(${test_name} PRIVATE ${ARG_SOURCES})
if(ARG_USE_BUNDLE)
target_link_libraries(${test_name} PRIVATE iceberg_bundle_static GTest::gmock_main)
else()
target_link_libraries(${test_name} PRIVATE iceberg_static GTest::gmock_main)
endif()
if(MSVC_TOOLCHAIN)
target_compile_options(${test_name} PRIVATE /bigobj)
endif()
add_test(NAME ${test_name} COMMAND ${test_name})
endfunction()
add_iceberg_test(schema_test
SOURCES
assign_id_visitor_test.cc
name_mapping_test.cc
partition_field_test.cc
partition_spec_test.cc
partition_value_test.cc
schema_field_test.cc
schema_test.cc
schema_util_test.cc
sort_field_test.cc
sort_order_test.cc
transform_human_string_test.cc
transform_test.cc
type_test.cc)
add_iceberg_test(table_test
SOURCES
location_provider_test.cc
metrics_config_test.cc
snapshot_summary_builder_test.cc
snapshot_test.cc
snapshot_util_test.cc
table_metadata_builder_test.cc
table_requirement_test.cc
table_requirements_test.cc
table_test.cc
table_update_test.cc)
add_iceberg_test(expression_test
SOURCES
aggregate_test.cc
expression_json_test.cc
expression_test.cc
expression_visitor_test.cc
inclusive_metrics_evaluator_test.cc
inclusive_metrics_evaluator_with_transform_test.cc
literal_test.cc
manifest_evaluator_test.cc
predicate_test.cc
projections_test.cc
residual_evaluator_test.cc
strict_metrics_evaluator_test.cc)
add_iceberg_test(json_serde_test
SOURCES
json_serde_test.cc
metadata_serde_test.cc
schema_json_test.cc)
add_iceberg_test(util_test
SOURCES
bucket_util_test.cc
config_test.cc
data_file_set_test.cc
decimal_test.cc
endian_test.cc
formatter_test.cc
location_util_test.cc
roaring_position_bitmap_test.cc
position_delete_index_test.cc
retry_util_test.cc
string_util_test.cc
struct_like_set_test.cc
transform_util_test.cc
truncate_util_test.cc
url_encoder_test.cc
uuid_test.cc
visit_type_test.cc)
add_iceberg_test(roaring_test SOURCES roaring_test.cc)
if(ICEBERG_BUILD_BUNDLE)
add_iceberg_test(avro_test
USE_BUNDLE
SOURCES
avro_data_test.cc
avro_test.cc
avro_schema_test.cc
avro_stream_test.cc)
add_iceberg_test(arrow_test
USE_BUNDLE
SOURCES
arrow_fs_file_io_test.cc
arrow_test.cc
gzip_decompress_test.cc
metadata_io_test.cc
struct_like_test.cc)
add_iceberg_test(catalog_test USE_BUNDLE SOURCES in_memory_catalog_test.cc)
add_iceberg_test(eval_expr_test
USE_BUNDLE
SOURCES
eval_expr_test.cc
evaluator_test.cc)
add_iceberg_test(manifest_test
USE_BUNDLE
SOURCES
delete_file_index_test.cc
manifest_group_test.cc
manifest_list_versions_test.cc
manifest_reader_stats_test.cc
manifest_reader_test.cc
manifest_writer_versions_test.cc
rolling_manifest_writer_test.cc)
add_iceberg_test(parquet_test
USE_BUNDLE
SOURCES
parquet_data_test.cc
parquet_schema_test.cc
parquet_test.cc)
add_iceberg_test(scan_test
USE_BUNDLE
SOURCES
file_scan_task_test.cc
incremental_append_scan_test.cc
table_scan_test.cc)
add_iceberg_test(table_update_test
USE_BUNDLE
SOURCES
expire_snapshots_test.cc
fast_append_test.cc
name_mapping_update_test.cc
snapshot_manager_test.cc
transaction_test.cc
update_location_test.cc
update_partition_spec_test.cc
update_partition_statistics_test.cc
update_properties_test.cc
update_schema_test.cc
update_sort_order_test.cc
update_statistics_test.cc)
add_iceberg_test(data_test
USE_BUNDLE
SOURCES
data_writer_test.cc
delete_loader_test.cc)
endif()
if(ICEBERG_BUILD_REST)
function(add_rest_iceberg_test test_name)
set(options USE_BUNDLE)
set(oneValueArgs)
set(multiValueArgs SOURCES)
cmake_parse_arguments(ARG
"${options}"
"${oneValueArgs}"
"${multiValueArgs}"
${ARGN})
add_executable(${test_name})
target_include_directories(${test_name} PRIVATE "${CMAKE_BINARY_DIR}/iceberg/test/")
target_sources(${test_name} PRIVATE ${ARG_SOURCES})
target_link_libraries(${test_name} PRIVATE GTest::gmock_main iceberg_rest_static)
if(MSVC_TOOLCHAIN)
target_compile_options(${test_name} PRIVATE /bigobj)
endif()
add_test(NAME ${test_name} COMMAND ${test_name})
endfunction()
add_rest_iceberg_test(rest_catalog_test
SOURCES
auth_manager_test.cc
endpoint_test.cc
rest_json_serde_test.cc
rest_util_test.cc)
if(ICEBERG_BUILD_REST_INTEGRATION_TESTS)
add_rest_iceberg_test(rest_catalog_integration_test
SOURCES
rest_catalog_integration_test.cc
util/cmd_util.cc
util/docker_compose_util.cc)
endif()
endif()