Skip to content

Commit 2b8a07b

Browse files
t-bltggiordano
andauthored
fix libgfortran version in auditor test (#1389)
* fix audit test * fix libgfortran test * Update test/auditing.jl Co-authored-by: Mosè Giordano <765740+giordano@users.noreply.github.com> * fix moar `Regex`es --------- Co-authored-by: Mosè Giordano <765740+giordano@users.noreply.github.com>
1 parent 515bf75 commit 2b8a07b

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

test/auditing.jl

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ end
5656
mktempdir() do build_path
5757
platform = Platform("x86_64", "linux"; march="avx")
5858
build_output_meta = nothing
59-
@test_logs (:info, "Building for x86_64-linux-gnu-march+avx") (:warn, r"is avx512, not avx as desired.$") match_mode=:any begin
59+
@test_logs (:info, "Building for x86_64-linux-gnu-march+avx") (:warn, r"is avx512, not avx as desired\.$") match_mode=:any begin
6060
build_output_meta = autobuild(
6161
build_path,
6262
"isa_tests",
@@ -105,7 +105,7 @@ end
105105
mktempdir() do build_path
106106
platform = Platform("x86_64", "linux"; march="avx512")
107107
build_output_meta = nothing
108-
@test_logs (:info, "Building for x86_64-linux-gnu-march+avx512") (:warn, r"is avx, not avx512 as desired. You may be missing some optimization flags during compilation.$") match_mode=:any begin
108+
@test_logs (:info, "Building for x86_64-linux-gnu-march+avx512") (:warn, r"is avx, not avx512 as desired\. You may be missing some optimization flags during compilation\.$") match_mode=:any begin
109109
build_output_meta = autobuild(
110110
build_path,
111111
"isa_tests",
@@ -240,7 +240,7 @@ end
240240
make install
241241
install_license /usr/share/licenses/libuv/LICENSE
242242
"""
243-
build_output_meta = @test_logs (:info, "Building for $(triplet(platform))") (:warn, r"Linked library libgcc_s.so.1") match_mode=:any do_build(build_path, script, platform, gcc_version)
243+
build_output_meta = @test_logs (:info, "Building for $(triplet(platform))") (:warn, r"Linked library libgcc_s\.so\.1") match_mode=:any do_build(build_path, script, platform, gcc_version)
244244
# Extract our platform's build
245245
@test haskey(build_output_meta, platform)
246246
tarball_path, tarball_hash = build_output_meta[platform][1:2]
@@ -299,7 +299,7 @@ end
299299
platform = Platform("x86_64", os)
300300
mktempdir() do build_path
301301
build_output_meta = nothing
302-
@test_logs (:info, r"Removing libtool file .*/destdir/lib/libfoo.la$") (:info, r"Removing libtool file .*/destdir/lib/libqux.la$") match_mode=:any begin
302+
@test_logs (:info, r"Removing libtool file .*/destdir/lib/libfoo\.la$") (:info, r"Removing libtool file .*/destdir/lib/libqux\.la$") match_mode=:any begin
303303
build_output_meta = autobuild(
304304
build_path,
305305
"libfoo",
@@ -342,7 +342,7 @@ end
342342
platform = Platform("x86_64", os)
343343
mktempdir() do build_path
344344
build_output_meta = nothing
345-
@test_logs (:info, r"Relocatize pkg-config file .*/destdir/lib/pkgconfig/libfoo.pc$") match_mode=:any begin
345+
@test_logs (:info, r"Relocatize pkg-config file .*/destdir/lib/pkgconfig/libfoo\.pc$") match_mode=:any begin
346346
build_output_meta = autobuild(
347347
build_path,
348348
"libfoo",
@@ -387,7 +387,7 @@ end
387387
for platform in [Platform("x86_64", "windows")]
388388
mktempdir() do build_path
389389
build_output_meta = nothing
390-
@test_logs (:warn, r"lib/libfoo.dll should be in `bin`") (:warn, r"Simple buildsystem detected") match_mode=:any begin
390+
@test_logs (:warn, r"lib/libfoo\.dll should be in `bin`") (:warn, r"Simple buildsystem detected") match_mode=:any begin
391391
build_output_meta = autobuild(
392392
build_path,
393393
"dll_moving",
@@ -502,7 +502,7 @@ end
502502
end
503503

504504
# Test that `audit()` warns about an absolute path within the prefix
505-
@test_logs (:warn, r"share/foo.conf contains an absolute path") match_mode=:any begin
505+
@test_logs (:warn, r"share/foo\.conf contains an absolute path") match_mode=:any begin
506506
Auditor.audit(Prefix(build_path); verbose=true)
507507
end
508508
end
@@ -519,7 +519,7 @@ end
519519
symlink("libfoo.so.1.2.3", joinpath(bindir, "libfoo.so"))
520520

521521
# Test that `audit()` warns about broken symlinks
522-
@test_logs (:warn, r"Broken symlink: bin/libzmq.dll.a") match_mode=:any begin
522+
@test_logs (:warn, r"Broken symlink: bin/libzmq\.dll\.a") match_mode=:any begin
523523
Auditor.warn_deadlinks(build_path)
524524
end
525525
end
@@ -532,7 +532,7 @@ end
532532

533533
mktempdir() do build_path
534534
hello_world = ExecutableProduct("hello_world_fortran", :hello_world_fortran)
535-
build_output_meta = @test_logs (:warn, r"CompilerSupportLibraries_jll") (:warn, r"Linked library libgfortran.so.5") (:warn, r"Linked library libquadmath.so.0") (:warn, r"Linked library libgcc_s.so.1") match_mode=:any begin
535+
build_output_meta = @test_logs (:warn, r"CompilerSupportLibraries_jll") (:warn, r"Linked library libgfortran\.so\.(4|5)") (:warn, r"Linked library libquadmath\.so\.0") (:warn, r"Linked library libgcc_s\.so\.1") match_mode=:any begin
536536
autobuild(
537537
build_path,
538538
"hello_fortran",
@@ -595,7 +595,7 @@ end
595595
# audit should warn us.
596596
libgfortran_versions = (3, 4, 5)
597597
other_libgfortran_version = libgfortran_versions[findfirst(v -> v != our_libgfortran_version.major, libgfortran_versions)]
598-
@test_logs (:warn, Regex("but we are supposedly building for libgfortran$(other_libgfortran_version)")) (:warn, r"Linked library libgfortran.so.5") (:warn, r"Linked library libquadmath.so.0") (:warn, r"Linked library libgcc_s.so.1") readmeta(hello_world_path) do ohs
598+
@test_logs (:warn, Regex("but we are supposedly building for libgfortran$(other_libgfortran_version)")) (:warn, r"Linked library libgfortran\.so\.(4|5)") (:warn, r"Linked library libquadmath\.so\.0") (:warn, r"Linked library libgcc_s\.so\.1") readmeta(hello_world_path) do ohs
599599
foreach(ohs) do oh
600600
p = deepcopy(platform)
601601
p["libgfortran_version"] = "$(other_libgfortran_version).0.0"
@@ -842,7 +842,7 @@ end
842842
@testset "hard-float ABI" begin
843843
platform = Platform("armv7l", "linux"; call_abi = "eabihf", libc = "glibc")
844844
mktempdir() do build_path
845-
build_output_meta = @test_logs (:error, r"libsoft.so does not match the hard-float ABI") match_mode=:any begin
845+
build_output_meta = @test_logs (:error, r"libsoft\.so does not match the hard-float ABI") match_mode=:any begin
846846
autobuild(
847847
build_path,
848848
"hard_float_ABI",
@@ -951,14 +951,14 @@ end
951951
oh = only(ohs)
952952
@test !is_for_platform(oh, platform)
953953
@test !check_os_abi(oh, platform)
954-
@test_logs((:warn, r"libnonote.so does not have a FreeBSD-branded ELF note"),
954+
@test_logs((:warn, r"libnonote\.so does not have a FreeBSD-branded ELF note"),
955955
match_mode=:any, check_os_abi(oh, platform; verbose=true))
956956
end
957957
readmeta(joinpath(testdir, "lib", "libbadosabi.so")) do ohs
958958
oh = only(ohs)
959959
@test !is_for_platform(oh, platform)
960960
@test !check_os_abi(oh, platform)
961-
@test_logs((:warn, r"libbadosabi.so has an ELF header OS/ABI value that is not set to FreeBSD"),
961+
@test_logs((:warn, r"libbadosabi\.so has an ELF header OS/ABI value that is not set to FreeBSD"),
962962
match_mode=:any, check_os_abi(oh, platform; verbose=true))
963963
end
964964
# Only audit the library we didn't mess with in the recipe

0 commit comments

Comments
 (0)