forked from timescale/timescaledb
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
175 lines (162 loc) · 4.17 KB
/
Copy pathCMakeLists.txt
File metadata and controls
175 lines (162 loc) · 4.17 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
include(GenerateTestSchedule)
set(TEST_FILES
alter.sql
alternate_users.sql
baserel_cache.sql
catalog_corruption.sql
chunk_adaptive.sql
chunk_publication.sql
chunk_utils.sql
chunks.sql
cluster.sql
constraint.sql
copy.sql
copy_where.sql
create_chunks.sql
create_hypertable.sql
create_table.sql
create_table_with.sql
cursor.sql
ddl.sql
ddl_errors.sql
ddl_extra.sql
debug_utils.sql
delete.sql
drop_extension.sql
drop_hypertable.sql
drop_rename_hypertable.sql
drop_schema.sql
dump_meta.sql
extension_scripts.sql
generated_as_identity.sql
hash.sql
index.sql
information_views.sql
insert_many.sql
insert_returning.sql
insert_single.sql
lateral.sql
merge.sql
partition.sql
partition_coercion.sql
partitioning.sql
pg_dump_unprivileged.sql
pg_join.sql
plain.sql
plan_hypertable_inline.sql
qual_filtering.sql
query.sql
relocate_extension.sql
reloptions.sql
size_utils.sql
sort_optimization.sql
sql_query.sql
tableam.sql
tableam_alter.sql
tablespace.sql
triggers.sql
truncate.sql
trusted_extension.sql
update.sql
upsert.sql
util.sql
uuid.sql
vacuum.sql
vacuum_parallel.sql
version.sql
license.sql)
set(TEST_TEMPLATES
agg_bookends.sql.in
append.sql.in
drop_owned.sql.in
grant_hypertable.sql.in
histogram_test.sql.in
insert.sql.in
null_exclusion.sql.in
plan_hashagg.sql.in
rowsecurity.sql.in
parallel.sql.in
partitionwise.sql.in
plan_expand_hypertable.sql.in
plan_ordered_append.sql.in
timestamp.sql.in
ts_merge.sql.in)
# Loader test must distinguish between Apache and TSL builds so we parametrize
# this here
set(LOADER_TEST_FILE loader-${TEST_LICENSE_SUFFIX})
configure_file(loader.sql.in
${CMAKE_CURRENT_SOURCE_DIR}/${LOADER_TEST_FILE}.sql)
# tests that fail or are unreliable when run in parallel bgw tests need to run
# first otherwise they are flaky
set(SOLO_TESTS
alter
alternate_users
bgw_launcher
chunk_utils
index
pg_dump_unprivileged
tablespace
telemetry
net)
list(APPEND SOLO_TESTS ${LOADER_TEST_FILE})
if(CMAKE_BUILD_TYPE MATCHES Debug)
list(
APPEND
TEST_FILES
alter_table_memory.sql
bgw_launcher.sql
c_unit_tests.sql
cache_invalidate_uaf.sql
copy_memory_usage.sql
metadata.sql
multi_transaction_index.sql
net.sql
partitioned_hypertable.sql
pg_dump.sql
symbol_conflict.sql
test_tss_callbacks.sql
test_utils.sql
${LOADER_TEST_FILE}.sql)
if(USE_TELEMETRY)
list(APPEND TEST_FILES telemetry.sql)
endif()
endif(CMAKE_BUILD_TYPE MATCHES Debug)
if((${PG_VERSION_MAJOR} GREATER_EQUAL "17"))
list(APPEND TEST_FILES tableam_alter_defaults.sql)
endif()
if((${PG_VERSION_MAJOR} GREATER_EQUAL "18"))
list(APPEND TEST_FILES insert_returning_old_new.sql)
endif()
# only test custom type if we are in 64-bit architecture
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
list(APPEND TEST_FILES custom_type.sql)
endif()
# Regression tests that vary with PostgreSQL version. Generated test files are
# put in the original source directory since all tests must be in the same
# directory. These files are updated when the template is edited, but not when
# the output file is deleted. If the output is deleted either recreate it
# manually, or rerun cmake on the root dir.
foreach(TEMPLATE_FILE ${TEST_TEMPLATES})
string(LENGTH ${TEMPLATE_FILE} TEMPLATE_NAME_LEN)
math(EXPR TEMPLATE_NAME_LEN ${TEMPLATE_NAME_LEN}-7)
string(SUBSTRING ${TEMPLATE_FILE} 0 ${TEMPLATE_NAME_LEN} TEMPLATE)
set(TEST_FILE ${TEMPLATE}-${TEST_VERSION_SUFFIX}.sql)
configure_file(${TEMPLATE_FILE} ${CMAKE_CURRENT_SOURCE_DIR}/${TEST_FILE}
@ONLY)
list(APPEND TEST_FILES ${TEST_FILE})
endforeach(TEMPLATE_FILE)
if(NOT TEST_GROUP_SIZE)
set(PARALLEL_GROUP_SIZE 20)
else()
set(PARALLEL_GROUP_SIZE ${TEST_GROUP_SIZE})
endif()
# Generate a test schedule for each configuration.
generate_test_schedule(
${TEST_SCHEDULE}
TEST_FILES
${TEST_FILES}
SOLO
${SOLO_TESTS}
GROUP_SIZE
${PARALLEL_GROUP_SIZE})
add_subdirectory(loader)