Skip to content

Commit b10c872

Browse files
committed
nfc(C++ modules) run tests with two phases compilation disabled for clang
1 parent 6facb1e commit b10c872

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

tests/projects/c++/modules/test_base.lua

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,10 @@ function build_tests(toolchain_name, opt)
8181
return
8282
end
8383

84+
local two_phases = (opt.two_phases == nil or opt.two_phases == true)
8485
local policies = "--policies=build.c++.modules.std:" .. (opt.stdmodule and "y" or "n")
8586
policies = policies .. ",build.c++.modules.fallbackscanner:" .. (opt.fallbackscanner and "y" or "n")
87+
policies = policies .. ",build.c++.modules.two_phases:" .. (two_phases and "y" or "n")
8688

8789
local platform = " "
8890
if opt.platform then
@@ -92,10 +94,8 @@ function build_tests(toolchain_name, opt)
9294
local runtimes = " "
9395
if opt.runtimes then
9496
runtimes = " --runtimes=" .. opt.runtimes .. " "
95-
print("running with config: (toolchain: %s, compiler: %s, version: %s, runtimes: %s)", toolchain_name, compiler, version, opt.runtimes)
96-
else
97-
print("running with config: (toolchain: %s, compiler: %s, version: %s)", toolchain_name, compiler, version)
9897
end
98+
print("running with config: (toolchain: %s, compiler: %s, version: %s, runtimes: %s, stdmodule: %s, fallback scanner: %s, two phases: %s)", toolchain_name, compiler, version, opt.runtimes or "default", opt.stdmodule or false, opt.fallbackscanner or false, two_phases)
9999

100100
local flags = ""
101101
if opt.flags then
@@ -124,21 +124,25 @@ function run_tests(clang_options, gcc_options, msvc_options)
124124
if clang_options then
125125
build_tests("llvm", clang_options)
126126
build_tests("clang", clang_options)
127+
build_tests("clang", table.join(clang_options, {two_phases = false}))
127128
if not clang_options.disable_clang_cl then
128129
local clang_cl_options = table.clone(clang_options)
129130
clang_cl_options.compiler = "clang-cl"
130131
clang_cl_options.version = CLANG_CL_MIN_VER
131132
build_tests("clang-cl", clang_cl_options)
133+
build_tests("clang-cl", table.join(clang_options, {two_phases = false}))
132134
end
133135
if not clang_options.stdmodule then
134136
build_tests("llvm", clang_libcpp_options)
135137
build_tests("clang", clang_libcpp_options)
138+
build_tests("clang", table.join(clang_libcpp_options, {two_phases = false}))
136139
else
137140
wprint("std modules tests skipped for Windows clang libc++ as it's not currently supported officially")
138141
end
139142
end
140143
if msvc_options then
141144
build_tests("msvc", msvc_options)
145+
build_tests("msvc", table.join(msvc_options, {two_phases = false}))
142146
end
143147
elseif is_subhost("macosx") then
144148
if clang_options then
@@ -161,29 +165,36 @@ function run_tests(clang_options, gcc_options, msvc_options)
161165
end
162166
build_tests("llvm", clang_options)
163167
build_tests("clang", clang_options)
168+
build_tests("clang", table.join(clang_options, {two_phases = false}))
164169
end
165170
elseif is_subhost("msys") then
166171
if clang_options then
167172
clang_options.platform = "mingw"
168173
clang_libcpp_options.platform = "mingw"
169174
build_tests("llvm", clang_options)
170175
build_tests("clang", clang_options)
176+
build_tests("clang", table.join(clang_options, {two_phases = false}))
171177
build_tests("llvm", clang_libcpp_options)
172178
build_tests("clang", clang_libcpp_options)
179+
build_tests("clang", table.join(clang_libcpp_options, {two_phases = false}))
173180
end
174181
if gcc_options then
175182
gcc_options.platform = "mingw"
176183
build_tests("gcc", gcc_options)
184+
build_tests("gcc", table.join(gcc_options, {two_phases = false}))
177185
end
178186
elseif is_host("linux") then
179187
if clang_options then
180188
build_tests("llvm", clang_options)
181189
build_tests("clang", clang_options)
190+
build_tests("clang", table.join(clang_options, {two_phases = false}))
182191
build_tests("llvm", clang_libcpp_options)
183192
build_tests("clang", clang_libcpp_options)
193+
build_tests("clang", table.join(clang_libcpp_options, {two_phases = false}))
184194
end
185195
if gcc_options then
186196
build_tests("gcc", gcc_options)
197+
build_tests("gcc", table.join(gcc_options, {two_phases = false}))
187198
end
188199
end
189200
end

0 commit comments

Comments
 (0)