tests: Parallelize

This commit is contained in:
Xiretza 2020-09-16 19:58:16 +02:00
parent acd47bbd52
commit 01260344d3
No known key found for this signature in database
GPG Key ID: 17B78226F7139993
3 changed files with 20 additions and 9 deletions

View File

@ -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

View File

@ -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 .."

View File

@ -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 ) )