Skip to content

Commit 8a7d133

Browse files
committed
Add explicit tests for CompilerSupportLibararies_jll message
1 parent ef03c34 commit 8a7d133

File tree

1 file changed

+27
-4
lines changed

1 file changed

+27
-4
lines changed

test/building.jl

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ shards_to_test = expand_cxxstring_abis(expand_gfortran_versions(shards_to_test))
126126
# Build for ALL the platforms
127127
shards_to_test,
128128
products,
129-
# No dependencies
130-
Dependency[];
129+
# Express a dependency on CSL to silence warning for fortran code
130+
[Dependency("CompilerSupportLibraries_jll")];
131131
# We need to be able to build go and rust and whatnot
132132
compilers=[:c, :go, :rust],
133133
)
@@ -190,15 +190,38 @@ end
190190
Windows(:i686; compiler_abi=CompilerABI(;libgfortran_version=v"3")),
191191
],
192192
[ExecutableProduct("hello_world_fortran", :hello_world_fortran)],
193-
# No dependencies
194-
Dependency[];
193+
# Express a dependency on CSL to silence warning for fortran code
194+
[Dependency("CompilerSupportLibraries_jll")];
195195
preferred_gcc_version=gcc_version,
196196
)
197197

198198
# Just a simple test to ensure that it worked.
199199
@test length(keys(build_output_meta)) == 6
200200
end
201201
end
202+
203+
# Test that building something that links against gfortran suggests depending on CSL
204+
@test_logs (:warn, r"CompilerSupportLibraries_jll") match_mode=:any begin
205+
mktempdir() do build_path
206+
build_output_meta = autobuild(
207+
build_path,
208+
"csl_dependency",
209+
v"1.0.0",
210+
# No sources
211+
FileSource[],
212+
# Build the test suite, install the binaries into our prefix's `bin`
213+
raw"""
214+
# Build testsuite
215+
make -j${nproc} -sC /usr/share/testsuite/fortran/hello_world install
216+
# Install fake license just to silence the warning
217+
install_license /usr/share/licenses/libuv/LICENSE
218+
""",
219+
[Linux(:x86_64; compiler_abi=CompilerABI(;libgfortran_version=v"3"))],
220+
[ExecutableProduct("hello_world_fortran", :hello_world_fortran)],
221+
Dependency[],
222+
)
223+
end
224+
end
202225
end
203226

204227
@testset "Invalid Arguments" begin

0 commit comments

Comments
 (0)