Skip to content

Commit 1fe7d9c

Browse files
committed
Completed slashes test
1 parent 671f23b commit 1fe7d9c

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

pyfpga/openflow.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
Implements support for an Open Source development flow.
99
"""
1010

11+
from pathlib import Path
1112
from pyfpga.project import Project
1213

1314

@@ -33,6 +34,10 @@ def _prog_custom(self):
3334
info = get_info(self.data.get('part', 'hx8k-ct256'))
3435
self.data['family'] = info['family']
3536

37+
@staticmethod
38+
def _get_absolute(path, ext):
39+
return Path(path).resolve().as_posix()
40+
3641

3742
def get_info(part):
3843
"""Get info about the FPGA part.

tests/test_tools.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import os
2+
13
from pathlib import Path
24
from pyfpga.factory import Factory
35

@@ -41,7 +43,7 @@ def test_quartus():
4143
generate(tool, 'PARTNAME')
4244
base = f'results/{tool}/{tool}'
4345
assert Path(f'{base}.tcl').exists(), 'file not found'
44-
assert Path(f'{base}-prog.tcl').exists(), 'file not found'
46+
assert Path(f'{base}-prog.sh').exists(), 'file not found'
4547

4648

4749
def test_vivado():
@@ -88,11 +90,15 @@ def generate(tool, part):
8890
prj.make()
8991
prj.prog()
9092
#
93+
separator = '\\'
94+
#
9195
for path in prj.data['includes']:
92-
assert "\\" not in path, f'invalid path {path}'
96+
assert separator not in path, f'invalid path {path}'
9397
for category in ['files', 'constraints']:
9498
for path in prj.data[category]:
95-
assert "\\" not in path, f'invalid path {path}'
99+
assert separator not in path, f'invalid path {path}'
96100
#
101+
if os.name == 'nt' and tool in ['diamond', 'quartus']:
102+
separator = '/'
97103
path = prj._get_bitstream()
98-
assert "\\" not in path, f'invalid path {path}'
104+
assert separator not in path, f'invalid path {path}'

0 commit comments

Comments
 (0)