Skip to content

Commit b105387

Browse files
committed
Moved regress.sh from examples/projects to tests
1 parent 176431f commit b105387

File tree

8 files changed

+33
-76
lines changed

8 files changed

+33
-76
lines changed

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
.PHONY: docs
44

5+
export PATH := $(PWD)/tests/mocks:$(PATH)
6+
57
all: docs lint test
68

79
docs:
@@ -14,7 +16,7 @@ lint:
1416

1517
test:
1618
pytest
17-
cd examples/projects && bash regress.sh --notool
19+
cd tests && bash regress.sh
1820

1921
clean:
2022
py3clean .

examples/projects/diamond.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
parser.add_argument(
1616
'--action', choices=['make', 'prog', 'all'], default='make'
1717
)
18-
parser.add_argument(
19-
'--notool', action='store_true'
20-
)
2118
args = parser.parse_args()
2219

2320
prj = Diamond(odir=f'results/diamond/{args.source}/{args.board}')
@@ -46,11 +43,7 @@
4643

4744
prj.set_top('Top')
4845

49-
try:
50-
if args.action in ['make', 'all']:
51-
prj.make()
52-
if args.action in ['prog', 'all']:
53-
prj.prog()
54-
except RuntimeError:
55-
if not args.notool:
56-
raise
46+
if args.action in ['make', 'all']:
47+
prj.make()
48+
if args.action in ['prog', 'all']:
49+
prj.prog()

examples/projects/ise.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
parser.add_argument(
1616
'--action', choices=['make', 'prog', 'all'], default='make'
1717
)
18-
parser.add_argument(
19-
'--notool', action='store_true'
20-
)
2118
args = parser.parse_args()
2219

2320
prj = Ise(odir=f'results/ise/{args.source}/{args.board}')
@@ -48,11 +45,7 @@
4845

4946
prj.set_top('Top')
5047

51-
try:
52-
if args.action in ['make', 'all']:
53-
prj.make()
54-
if args.action in ['prog', 'all']:
55-
prj.prog()
56-
except RuntimeError:
57-
if not args.notool:
58-
raise
48+
if args.action in ['make', 'all']:
49+
prj.make()
50+
if args.action in ['prog', 'all']:
51+
prj.prog()

examples/projects/libero.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414
parser.add_argument(
1515
'--action', choices=['make', 'prog', 'all'], default='make'
1616
)
17-
parser.add_argument(
18-
'--notool', action='store_true'
19-
)
2017
args = parser.parse_args()
2118

2219
prj = Libero(odir=f'results/libero/{args.source}/{args.board}')
@@ -53,11 +50,7 @@
5350

5451
prj.set_top('Top')
5552

56-
try:
57-
if args.action in ['make', 'all']:
58-
prj.make()
59-
if args.action in ['prog', 'all']:
60-
prj.prog()
61-
except RuntimeError:
62-
if not args.notool:
63-
raise
53+
if args.action in ['make', 'all']:
54+
prj.make()
55+
if args.action in ['prog', 'all']:
56+
prj.prog()

examples/projects/openflow.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
parser.add_argument(
1717
'--action', choices=['make', 'prog', 'all'], default='make'
1818
)
19-
parser.add_argument(
20-
'--notool', action='store_true'
21-
)
2219
args = parser.parse_args()
2320

2421
prj = Openflow(odir=f'results/openflow/{args.source}/{args.board}')
@@ -62,11 +59,7 @@
6259

6360
prj.set_top('Top')
6461

65-
try:
66-
if args.action in ['make', 'all']:
67-
prj.make()
68-
if args.action in ['prog', 'all']:
69-
prj.prog()
70-
except RuntimeError:
71-
if not args.notool:
72-
raise
62+
if args.action in ['make', 'all']:
63+
prj.make()
64+
if args.action in ['prog', 'all']:
65+
prj.prog()

examples/projects/quartus.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
parser.add_argument(
1616
'--action', choices=['make', 'prog', 'all'], default='make'
1717
)
18-
parser.add_argument(
19-
'--notool', action='store_true'
20-
)
2118
args = parser.parse_args()
2219

2320
prj = Quartus(odir=f'results/quartus/{args.source}/{args.board}')
@@ -47,11 +44,7 @@
4744

4845
prj.set_top('Top')
4946

50-
try:
51-
if args.action in ['make', 'all']:
52-
prj.make()
53-
if args.action in ['prog', 'all']:
54-
prj.prog()
55-
except RuntimeError:
56-
if not args.notool:
57-
raise
47+
if args.action in ['make', 'all']:
48+
prj.make()
49+
if args.action in ['prog', 'all']:
50+
prj.prog()

examples/projects/vivado.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
parser.add_argument(
1616
'--action', choices=['make', 'prog', 'all'], default='make'
1717
)
18-
parser.add_argument(
19-
'--notool', action='store_true'
20-
)
2118
args = parser.parse_args()
2219

2320
prj = Vivado(odir=f'results/vivado/{args.source}/{args.board}')
@@ -53,11 +50,7 @@
5350

5451
prj.set_top('Top')
5552

56-
try:
57-
if args.action in ['make', 'all']:
58-
prj.make()
59-
if args.action in ['prog', 'all']:
60-
prj.prog()
61-
except RuntimeError:
62-
if not args.notool:
63-
raise
53+
if args.action in ['make', 'all']:
54+
prj.make()
55+
if args.action in ['prog', 'all']:
56+
prj.prog()

examples/projects/regress.sh renamed to tests/regress.sh

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ TOOLS["vivado"]="zybo arty"
1919

2020
SOURCES=("vlog" "vhdl" "slog")
2121

22+
SDIR=$PWD
23+
TDIR=../examples/projects
24+
2225
SPECIFIED_TOOL=""
2326
NOTOOL=false
2427
while [[ "$#" -gt 0 ]]; do
@@ -27,10 +30,6 @@ while [[ "$#" -gt 0 ]]; do
2730
SPECIFIED_TOOL="$2"
2831
shift 2
2932
;;
30-
--notool)
31-
NOTOOL=true
32-
shift
33-
;;
3433
*)
3534
echo "Invalid option: $1"
3635
exit 1
@@ -49,11 +48,9 @@ for TOOL in "${!TOOLS[@]}"; do
4948
continue
5049
fi
5150
echo "> $TOOL - $BOARD - $SOURCE"
52-
if [[ "$NOTOOL" == true ]]; then
53-
python3 $TOOL.py --board $BOARD --source $SOURCE --action all --notool
54-
else
55-
python3 $TOOL.py --board $BOARD --source $SOURCE --action all
56-
fi
51+
cd $TDIR;
52+
python3 $TOOL.py --board $BOARD --source $SOURCE --action all;
53+
cd $SDIR;
5754
done
5855
done
5956
done

0 commit comments

Comments
 (0)