@@ -450,13 +450,25 @@ end
450
450
# Attempt to run the executable, we expect it to work since it's our platform:
451
451
hello_world_path = locate (hello_world, Prefix (testdir); platform= platform)
452
452
with_libgfortran () do
453
- @test strip ( String ( read ( ` $hello_world_path ` )) ) == " Hello, World!"
453
+ @test readchomp ( ` $hello_world_path ` ) == " Hello, World!"
454
454
end
455
455
456
456
# If we audit the testdir, pretending that we're trying to build an ABI-agnostic
457
457
# tarball, make sure it warns us about it.
458
458
@test_logs (:warn , r" links to libgfortran!" ) match_mode= :any begin
459
- Auditor. audit (Prefix (testdir); platform= BinaryBuilderBase. abi_agnostic (platform), autofix= false )
459
+ @test ! Auditor. audit (Prefix (testdir); platform= BinaryBuilderBase. abi_agnostic (platform), autofix= false )
460
+ # Make sure audit is otherwise happy with the executable
461
+ @test Auditor. audit (Prefix (testdir); platform= platform, autofix= false )
462
+ end
463
+
464
+ # Let's pretend that we're building for a different libgfortran version:
465
+ # audit should warn us.
466
+ libgfortran_versions = (3 , 4 , 5 )
467
+ other_libgfortran_version = libgfortran_versions[findfirst (v -> v != our_libgfortran_version. major, libgfortran_versions)]
468
+ @test_logs (:warn , Regex (" but we are supposedly building for libgfortran$(other_libgfortran_version) " )) readmeta (hello_world_path) do oh
469
+ p = deepcopy (platform)
470
+ p[" libgfortran_version" ] = " $(other_libgfortran_version) .0.0"
471
+ @test ! Auditor. audit (Prefix (testdir); platform= p, autofix= false )
460
472
end
461
473
end
462
474
end
0 commit comments