Merge pull request #1143 from YosysHQ/clifford/fix1135
[yosys.git] / tests / bram / run-test.sh
1 #!/bin/bash
2
3 # run this test many times:
4 # MAKE="make -j8" time bash -c 'for ((i=0; i<100; i++)); do echo "-- $i --"; bash run-test.sh || exit 1; done'
5
6 set -e
7
8 OPTIND=1
9 count=5
10 seed="" # default to no seed specified
11 debug=""
12 while getopts "c:dS:" opt
13 do
14 case "$opt" in
15 c) count="$OPTARG" ;;
16 d) debug="-d" ;;
17 S) seed="-S $OPTARG" ;;
18 esac
19 done
20 shift "$((OPTIND-1))"
21
22 rm -rf temp
23 mkdir -p temp
24
25 echo "generating tests.."
26 python3 generate.py $debug -c $count $seed
27
28 {
29 echo -n "all:"
30 for i in $( ls temp/brams_*.txt | sed 's,.*_,,; s,\..*,,;' ); do
31 for j in $( ls temp/brams_*.txt | sed 's,.*_,,; s,\..*,,;' | grep -v $i ); do
32 echo -n " temp/job_${i}_${j}.ok"
33 done; done
34 echo
35 for i in $( ls temp/brams_*.txt | sed 's,.*_,,; s,\..*,,;' ); do
36 for j in $( ls temp/brams_*.txt | sed 's,.*_,,; s,\..*,,;' | grep -v $i ); do
37 echo "temp/job_${i}_${j}.ok:"
38 echo " @bash run-single.sh ${i} ${j}"
39 echo " @echo 'Passed memory_bram test ${i}_${j}.'"
40 echo " @touch \$@"
41 done; done
42 } > temp/makefile
43
44 echo "running tests.."
45 ${MAKE:-make} -f temp/makefile
46
47 exit 0