forked from regro/cf-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_flang.py
59 lines (50 loc) · 1.57 KB
/
test_flang.py
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import os
import networkx as nx
import pytest
from test_migrators import run_test_migration
from conda_forge_tick.migrators import FlangMigrator, Version
TEST_YAML_PATH = os.path.join(os.path.dirname(__file__), "test_yaml")
TOTAL_GRAPH = nx.DiGraph()
TOTAL_GRAPH.graph["outputs_lut"] = {}
FLANG = FlangMigrator()
VERSION_WITH_FLANG = Version(
set(),
piggy_back_migrations=[FLANG],
total_graph=TOTAL_GRAPH,
)
@pytest.mark.parametrize(
"feedstock,new_ver",
[
# multiple outputs
("lapack", "1.10.0"),
# comments in compiler block
("prima", "1.10.0"),
# remove selector for non-m2w64 fortran compilers
("mfront", "1.10.0"),
# includes cxx (non-m2w64) as a language
("plplot", "1.10.0"),
# includes m2w64_cxx compiler
("pcmsolver-split", "1.10.0"),
],
)
def test_flang(feedstock, new_ver, tmp_path):
before = f"flang_{feedstock}_before_meta.yaml"
with open(os.path.join(TEST_YAML_PATH, before)) as fp:
in_yaml = fp.read()
after = f"flang_{feedstock}_after_meta.yaml"
with open(os.path.join(TEST_YAML_PATH, after)) as fp:
out_yaml = fp.read()
run_test_migration(
m=VERSION_WITH_FLANG,
inp=in_yaml,
output=out_yaml,
kwargs={"new_version": new_ver},
prb="Dependencies have been updated if changed",
mr_out={
"migrator_name": "Version",
"migrator_version": VERSION_WITH_FLANG.migrator_version,
"version": new_ver,
},
tmp_path=tmp_path,
should_filter=False,
)