Skip to content

Commit 5568bb1

Browse files
committed
Add to check helpers into the regress script
1 parent 1fe7d9c commit 5568bb1

File tree

5 files changed

+30
-4
lines changed

5 files changed

+30
-4
lines changed

tests/mocks/libero

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import re
1111
import subprocess
1212
import sys
1313

14+
from pathlib import Path
15+
1416

1517
parser = argparse.ArgumentParser()
1618

@@ -47,6 +49,9 @@ with open(args.source, 'r', encoding='utf-8') as file:
4749
match = re.search(pattern, file.read())
4850
if match:
4951
project = match.group(1)
52+
directory = Path('libero')
53+
directory.mkdir(parents=True, exist_ok=True)
54+
open(directory / f'{project}.prjx', 'w', encoding='utf-8').close()
5055
open(f'{project}.ppd', 'w', encoding='utf-8').close()
5156

5257
print(f'INFO:the {tool.upper()} mock has been executed')

tests/mocks/quartus_sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ with open(args.script, 'r', encoding='utf-8') as file:
4747
match = re.search(pattern, file.read())
4848
if match:
4949
project = match.group(1)
50+
open(f'{project}.qpf', 'w', encoding='utf-8').close()
5051
open(f'{project}.sof', 'w', encoding='utf-8').close()
5152

5253
print(f'INFO:the {tool.upper()} mock has been executed')

tests/mocks/vivado

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ with open(args.source, 'r', encoding='utf-8') as file:
7676
match = re.search(pattern, file.read())
7777
if match:
7878
project = match.group(1)
79+
open(f'{project}.xpr', 'w', encoding='utf-8').close()
7980
open(f'{project}.bit', 'w', encoding='utf-8').close()
8081

8182
print(f'INFO:the {tool.upper()} mock has been executed')

tests/mocks/xtclsh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ with open(args.source, 'r', encoding='utf-8') as file:
4040
match = re.search(pattern, file.read())
4141
if match:
4242
project = match.group(1)
43+
open(f'{project}.xise', 'w', encoding='utf-8').close()
4344
open(f'{project}.bit', 'w', encoding='utf-8').close()
4445

4546
print(f'INFO:the {tool.upper()} mock has been executed')

tests/regress.sh

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88

99
set -e
1010

11+
SDIR=$PWD
12+
13+
echo "##################################################################################"
14+
echo "# Tools #"
15+
echo "##################################################################################"
16+
1117
declare -A TOOLS
1218

1319
TOOLS["diamond"]="brevia2"
@@ -19,9 +25,6 @@ TOOLS["vivado"]="zybo arty"
1925

2026
SOURCES=("vlog" "vhdl" "slog")
2127

22-
SDIR=$PWD
23-
TDIR=../examples/projects
24-
2528
SPECIFIED_TOOL=""
2629
NOTOOL=false
2730
while [[ "$#" -gt 0 ]]; do
@@ -48,9 +51,24 @@ for TOOL in "${!TOOLS[@]}"; do
4851
continue
4952
fi
5053
echo "> $TOOL - $BOARD - $SOURCE"
51-
cd $TDIR;
54+
cd ../examples/projects;
5255
python3 $TOOL.py --board $BOARD --source $SOURCE --action all;
5356
cd $SDIR;
5457
done
5558
done
5659
done
60+
61+
echo "##################################################################################"
62+
echo "# Helpers #"
63+
echo "##################################################################################"
64+
65+
cd ../examples/helpers
66+
67+
for TOOL in "${!TOOLS[@]}"; do
68+
if [[ "$TOOL" == "diamond" ]]; then
69+
continue
70+
fi
71+
bash "$TOOL".sh
72+
done
73+
74+
cd $SDIR

0 commit comments

Comments
 (0)