Skip to content

Commit 9318deb

Browse files
committed
fix(CI): don't run command_line_test in GitHub CI
1 parent 23c4dbb commit 9318deb

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

test/main.f90

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,28 @@ program main
2525
call formats_test%report(passes, tests)
2626
call test_result_test%report(passes, tests)
2727
call string_test%report(passes, tests)
28-
if (this_image()==1) then
29-
call command_line_test%report(passes, tests)
30-
print *, new_line('a'), "_________ In total, ",passes," of ",tests, " tests pass. _________"
31-
end if
28+
29+
if (.not. GitHub_CI()) call command_line_test%report(passes, tests)
30+
31+
if (this_image()==1) print *, new_line('a'), "_________ In total, ",passes," of ",tests, " tests pass. _________"
32+
3233
if (passes /= tests) error stop
34+
35+
contains
36+
37+
logical function GitHub_CI()
38+
integer name_length
39+
character(len=:), allocatable :: CI
40+
41+
call get_environment_variable("CI", length=name_length)
42+
43+
if (name_length==0) then
44+
GitHub_CI = .false.
45+
else
46+
allocate(character(len=name_length):: CI)
47+
call get_environment_variable("CI", value=CI)
48+
GitHub_CI = merge(.true., .false., CI=="true")
49+
end if
50+
end function
51+
3352
end program

0 commit comments

Comments
 (0)