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 .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,21 @@ 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+
41+ def test_f90 (monkeypatch , tmp_path ):
42+ src_dir = tmp_path / "source"
43+ build_dir = tmp_path / "build"
44+ shutil .copytree (DIR / "packages/f90dual" , src_dir )
45+ monkeypatch .chdir (src_dir )
46+
47+ cmake_dir = src_dir / "cmake"
48+ cmake_dir .mkdir ()
49+ f2py_cmake .vendor .vendorize (cmake_dir )
50+
51+ inner_cmake_dir = src_dir / "src/subrepo/cmake"
52+ inner_cmake_dir .mkdir ()
53+ f2py_cmake .vendor .vendorize (inner_cmake_dir )
54+
55+ subprocess .run (["cmake" , "-S" , "." , "-B" , str (build_dir )], check = True )
0 commit comments