tests: Parallelize
authorXiretza <xiretza@xiretza.xyz>
Wed, 16 Sep 2020 17:58:16 +0000 (19:58 +0200)
committerXiretza <xiretza@xiretza.xyz>
Mon, 21 Sep 2020 13:07:02 +0000 (15:07 +0200)
tests/gen-tests-makefile.sh
tests/memories/run-test.sh
tests/opt_share/run-test.sh

index 176890d7037feee355faa8dcdfe4179145e72af8..ab8fb7013b6016850f5ae68793774bab8dc1925f 100755 (executable)
@@ -6,7 +6,7 @@ YOSYS_BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")"/../ >/dev/null 2>&1 && pwd)
 generate_target() {
        target_name=$1
        test_command=$2
-       echo "all:: $target_name"
+       echo "all: $target_name"
        echo ".PHONY: $target_name"
        echo "$target_name:"
        printf "\t@%s\n" "$test_command"
@@ -65,7 +65,7 @@ generate_tests() {
        fi
 
        echo ".PHONY: all"
-       echo "all::"
+       echo "all:"
 
        if [[ $do_ys = true ]]; then
                for x in *.ys; do
index 8d1a8b41396d3c6c33e5831b622fcdb15aa25f0b..376f5bf79b795db94196f1cda220419abc3ec504 100755 (executable)
@@ -9,12 +9,12 @@ while getopts "A:S:" opt
 do
     case "$opt" in
        A) abcopt="-A $OPTARG" ;;
-       S) seed="-S $OPTARG" ;;
+       S) seed="$OPTARG" ;;
     esac
 done
 shift "$((OPTIND-1))"
 
-bash ../tools/autotest.sh $abcopt $seed -G *.v
+${MAKE:-make} -f ../tools/autotest.mk SEED="$seed" EXTRA_FLAGS="$abcopt" *.v
 
 for f in `egrep -l 'expect-(wr-ports|rd-ports|rd-clk)' *.v`; do
        echo -n "Testing expectations for $f .."
index e0155264680b16979a405fc42e342752bf7c112c..e0008a259b2544bf439c4cb614d5c25f08aa9195 100755 (executable)
@@ -22,12 +22,23 @@ mkdir -p temp
 echo "generating tests.."
 python3 generate.py -c $count $seed
 
+{
+       echo ".PHONY: all"
+       echo "all:"
+
+       for i in $( ls temp/*.ys | sed 's,[^0-9],,g; s,^0*\(.\),\1,g;' ); do
+               idx=$( printf "%05d" $i )
+               echo ".PHONY: test-$idx"
+               echo "all: test-$idx"
+               echo "test-$idx:"
+               printf "\t@%s\n" \
+                       "echo -n [$i]" \
+                       "../../yosys -ql temp/uut_${idx}.log temp/uut_${idx}.ys"
+       done
+} > temp/makefile
+
 echo "running tests.."
-for i in $( ls temp/*.ys | sed 's,[^0-9],,g; s,^0*\(.\),\1,g;' ); do
-       echo -n "[$i]"
-       idx=$( printf "%05d" $i )
-       ../../yosys -ql temp/uut_${idx}.log temp/uut_${idx}.ys
-done
+${MAKE:-make} -f temp/makefile
 echo
 
 failed_share=$( echo $( gawk '/^#job#/ { j=$2; db[j]=0; } /^Removing [246] cells/ { delete db[j]; } END { for (j in db) print(j); }' temp/all_share_log.txt ) )