Skip to content

Commit 36e82f2

Browse files
committed
Add support for toggling Fortran features
1 parent 55d94b0 commit 36e82f2

File tree

19 files changed

+308
-8
lines changed

19 files changed

+308
-8
lines changed

ci/run_tests.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,14 @@ pushd cpp_files
158158
"$fpm" test
159159
popd
160160

161+
# Test Fortran features
162+
for feature in free-format fixed-format implicit-typing implicit-external
163+
do
164+
pushd $feature
165+
"$fpm" run
166+
popd
167+
done
168+
161169
# Test app exit codes
162170
pushd fpm_test_exit_code
163171
"$fpm" build
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
program test
2+
use lib
3+
call hello
4+
end
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
name = "fixed-format"
2+
fortran.source-format = "fixed"
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module lib
2+
contains
3+
subroutine h e l l o
4+
print '(a)',
5+
+"Hello, fixed world!"
6+
end subroutine
7+
end module
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
program test
2+
use lib
3+
call hello
4+
end

example_packages/free-format/fpm.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
name = "free-format"
2+
fortran.source-format = "free"
3+
executable = [{main="main.f", name="free-format"}]
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module lib
2+
contains
3+
subroutine hello
4+
print '(a)', "Hello, free world!"
5+
end subroutine
6+
end module
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
program test
2+
integer :: ijk
3+
call impl(ijk)
4+
if (ijk /= 1) error stop
5+
end program test
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
name = "implicit-external"
2+
fortran.implicit-external = true
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
subroutine impl(ijk)
2+
integer :: ijk
3+
ijk = 1
4+
end subroutine impl

0 commit comments

Comments
 (0)