aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/synth
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-06-30 20:52:42 +0200
committerTristan Gingold <tgingold@free.fr>2019-06-30 20:52:42 +0200
commit09fe97ce90ecf0dee26f80873e9697d2b68b7a24 (patch)
treec190f897fbe03da28d04d6d033306331d5f8f51a /testsuite/synth
parentf97914ff5d5c4c08c1c960342c162ccd6d5fb5ce (diff)
downloadghdl-09fe97ce90ecf0dee26f80873e9697d2b68b7a24.tar.gz
ghdl-09fe97ce90ecf0dee26f80873e9697d2b68b7a24.tar.bz2
ghdl-09fe97ce90ecf0dee26f80873e9697d2b68b7a24.zip
testsuite/synth: add testsuite.sh
Diffstat (limited to 'testsuite/synth')
-rwxr-xr-xtestsuite/synth/testsuite.sh53
1 files changed, 53 insertions, 0 deletions
diff --git a/testsuite/synth/testsuite.sh b/testsuite/synth/testsuite.sh
new file mode 100755
index 000000000..7eb9c3269
--- /dev/null
+++ b/testsuite/synth/testsuite.sh
@@ -0,0 +1,53 @@
+#! /bin/sh
+
+# Driver for the synth testsuite.
+
+set -e
+
+# This is the only place where test dirs are specified. Do not duplicate this
+# line
+dirs="*[0-9]"
+
+failures=""
+full=n
+
+for opt; do
+ case "$opt" in
+ -k | --keep-going) full=y ;;
+ --dir=*) dirs=`echo $opt | sed -e 's/--dir=//'` ;;
+ --skip=*) d=`echo $opt | sed -e 's/--skip=//'`
+ dirs=`echo "" $dirs | sed -e "s/ $d//"` ;;
+ --start-at=*) d=`echo $opt | sed -e 's/--start-at=//'`
+ dirs=`echo "" $dirs | sed -e "s/^.* $d//"`
+ dirs="$d $dirs" ;;
+ --list-tests) echo $dirs; exit 0;;
+ *) echo "Unknown option $opt"
+ exit 2
+ ;;
+ esac
+done
+
+singlerun() {
+ echo ""
+ echo "Synth dir $1:"
+ cd $1
+ if ! ./testsuite.sh; then
+ echo "#################################################################"
+ echo "######### FAILURE: $1"
+ echo "#################################################################"
+ if [ $2 = "y" ]; then
+ failures="$failures $1"
+ else
+ exit 1;
+ fi
+ fi
+ cd ..
+}
+
+for i in $dirs; do singlerun $i $full; done
+
+if [ x"$failures" = x"" ]; then
+ echo "tests are successful" && exit 0
+else
+ echo "test failed ($failures)" && exit 1
+fi