#!/usr/bin/python3
"""
CMake fragment handling for Fortran : tests

Copyright (C) 2025 Alastair McKinstry <mckinstry@debian.org>
Released under the GPL-3 Gnu Public License.
"""

import dhfortran.debhelper as dh
import os
import pytest
from dhfortran.cmake import CMakeFileHelper


@pytest.fixture()
def set_env():
    os.environ["NO_ACT"] = "1"


def test_debhelper_initialization():
    opts = dh.build_options()
    c = CMakeFileHelper(opts)


# @pytest.mark.xfail
# def test_clone_and_rename(set_env):
#     assert (
#         dh.clone_and_rename("hipsparse-targets.cmake", flavor="gfortran")
#         == "hipsparse-gfortran-targets.cmake"
#     )
#     assert dh.clone_and_rename("eccodes.pc", flavor="gfortran") == "eccodes-gfortran.pc"
#     assert (
#         dh.clone_and_rename("/usr/lib/eccodes.pc", flavor="gfortran")
#         == "/usr/lib/eccodes-gfortran.pc"
#     )
#     assert (
#         dh.clone_and_rename("/usr/lib/eccodes.foo.pc", flavor="gfortran")
#         == "/usr/lib/eccodes.foo-gfortran.pc"
#     )


if __name__ == "__main__":
    import pytest

    pytest.main()
