Skip to content

Commit

Permalink
Fix gcc paths again
Browse files Browse the repository at this point in the history
  • Loading branch information
rjfarmer committed Nov 15, 2023
1 parent 05d2e55 commit cafac3b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/ci-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ jobs:
brew install gcc@${{ matrix.fortran-compiler }}
ln -s /usr/local/bin/gfortran-${{ matrix.fortran-compiler }} /usr/local/bin/gfortran
ln -s /usr/local/bin/gcc-${{ matrix.fortran-compiler }} /usr/local/bin/gcc
ln -s /usr/local/bin/gfortran-${{ matrix.fortran-compiler }} /usr//bin/gfortran
ln -s /usr/local/bin/gcc-${{ matrix.fortran-compiler }} /usr//bin/gcc
- name: Install dependencies
run: |
Expand Down
14 changes: 10 additions & 4 deletions tests/compile_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os, sys
import ctypes
from pprint import pprint
import platform

os.environ["_GFORT2PY_TEST_FLAG"] = "1"

Expand All @@ -9,6 +10,11 @@

import pytest

if platform.system() == "Darwin":
FC = "/usr/local/bin/gfortran"
else:
FC = "/usr/bin/gfortran"


class TestCompileMethods:
def test_compile_nomod_str(self):
Expand All @@ -19,7 +25,7 @@ def test_compile_nomod_str(self):
end function myfunc
"""

x = gf.compile(string=fstr)
x = gf.compile(string=fstr, FC=FC)

result = x.myfunc(1, 2)

Expand All @@ -36,21 +42,21 @@ def test_compile_mod_str(self):
end module
"""

x = gf.compile(string=fstr)
x = gf.compile(string=fstr, FC=FC)

result = x.myfunc(1, 2)

assert result.result == 3

def test_compile_nomod_file(self):
x = gf.compile(file="tests/compile_nomod_test.f90")
x = gf.compile(file="tests/compile_nomod_test.f90", FC=FC)

result = x.myfunc(1, 2)

assert result.result == 3

def test_compile_mod_file(self):
x = gf.compile(file="tests/compile_mod_test.f90")
x = gf.compile(file="tests/compile_mod_test.f90", FC=FC)

result = x.myfunc(1, 2)

Expand Down

0 comments on commit cafac3b

Please sign in to comment.