aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-08-14 07:26:31 +0200
committerTristan Gingold <tgingold@free.fr>2019-08-14 07:26:31 +0200
commit35b8e809181678950b4f591ce011d026ad0fa03d (patch)
tree320e0e1fdfab5e857e0fbe653d2c0667863ef3c5 /testsuite
parenta7c5f4e0e2a8b41e98c1ccbefd84706a1af4ed3d (diff)
downloadghdl-35b8e809181678950b4f591ce011d026ad0fa03d.tar.gz
ghdl-35b8e809181678950b4f591ce011d026ad0fa03d.tar.bz2
ghdl-35b8e809181678950b4f591ce011d026ad0fa03d.zip
testsuite/python: add testsuite.sh
Diffstat (limited to 'testsuite')
-rwxr-xr-xtestsuite/python/testsuite.sh53
1 files changed, 53 insertions, 0 deletions
diff --git a/testsuite/python/testsuite.sh b/testsuite/python/testsuite.sh
new file mode 100755
index 000000000..12b367f2c
--- /dev/null
+++ b/testsuite/python/testsuite.sh
@@ -0,0 +1,53 @@
+#! /bin/sh
+
+# Driver for a 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 "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