11from __future__ import annotations
22
33import importlib .metadata
4+ import shutil
5+ import subprocess
46import zipfile
57from pathlib import Path
68
9+ import pytest
710from scikit_build_core .build import build_wheel
811
912import f2py_cmake as m
13+ import f2py_cmake .vendor
1014
1115DIR = Path (__file__ ).parent .resolve ()
1216
@@ -15,6 +19,7 @@ def test_version():
1519 assert importlib .metadata .version ("f2py_cmake" ) == m .__version__
1620
1721
22+ @pytest .mark .skipif (shutil .which ("cmake" ) is None , reason = "CMake not found" )
1823def test_f77 (monkeypatch , tmp_path ):
1924 monkeypatch .chdir (DIR / "packages/f77" )
2025 build_dir = tmp_path / "build"
@@ -30,3 +35,20 @@ def test_f77(monkeypatch, tmp_path):
3035 build_files = {x .name for x in build_dir .iterdir ()}
3136 assert "fibbymodule.c" in build_files
3237 assert "fibby-f2pywrappers.f" in build_files
38+
39+
40+ def test_f90 (monkeypatch , tmp_path ):
41+ src_dir = tmp_path / "source"
42+ build_dir = tmp_path / "build"
43+ shutil .copytree (DIR / "packages/f90dual" , src_dir )
44+ monkeypatch .chdir (src_dir )
45+
46+ cmake_dir = src_dir / "cmake"
47+ cmake_dir .mkdir ()
48+ f2py_cmake .vendor .vendorize (cmake_dir )
49+
50+ inner_cmake_dir = src_dir / "src/subrepo/cmake"
51+ inner_cmake_dir .mkdir ()
52+ f2py_cmake .vendor .vendorize (inner_cmake_dir )
53+
54+ subprocess .run (["cmake" , "-S" , "." , "-B" , str (build_dir )], check = True )
0 commit comments