Skip to content

Commit fc176f1

Browse files
committed
[introspection] add flags check tests
1 parent 6561164 commit fc176f1

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

test/fpm_test/test_compiler.f90

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,22 @@ subroutine test_check_fortran_source_runs(error)
6868
link_flags=" -some-really-invalid-link-flag")) then
6969
call test_failed(error, "Invalid build and link flags did not trigger an error")
7070
return
71-
end if
71+
end if
72+
73+
!> Test the flag check wrapper
74+
if (compiler%check_flags_supported(compile_flags='-Werror=unknown-flag')) then
75+
call test_failed(error, "Invalid compile flags did not trigger an error")
76+
return
77+
end if
78+
if (compiler%check_flags_supported(link_flags='-Wl,--nonexistent-linker-option')) then
79+
call test_failed(error, "Invalid link flags did not trigger an error")
80+
return
81+
end if
82+
if (compiler%check_flags_supported(compile_flags='-Werror=unknown-flag', &
83+
link_flags='-Wl,--nonexistent-linker-option')) then
84+
call test_failed(error, "Invalid compile and link flags did not trigger an error")
85+
return
86+
end if
7287

7388
end subroutine test_check_fortran_source_runs
7489

0 commit comments

Comments
 (0)