File: debhelper.py

package info (click to toggle)
dh-fortran 0.57
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 816 kB
  • sloc: f90: 5,705; python: 1,485; perl: 610; makefile: 80; sh: 7
file content (45 lines) | stat: -rw-r--r-- 1,096 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/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()