aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
authorPatrick Lehmann <Patrick.Lehmann@plc2.de>2020-12-28 23:12:21 +0100
committerPatrick Lehmann <Patrick.Lehmann@plc2.de>2020-12-28 23:12:21 +0100
commit13fd5ccc6a8b9e59212b5493eb319c6f932eb906 (patch)
tree8ba15020049ae61917ca2c389a5b28feab6d6511 /testsuite
parentbfd38acc0c6f3f82823fa1a496e90ef1e64da997 (diff)
parent8da838eff60114746a5d81e7d0c21bb5e777546e (diff)
downloadghdl-13fd5ccc6a8b9e59212b5493eb319c6f932eb906.tar.gz
ghdl-13fd5ccc6a8b9e59212b5493eb319c6f932eb906.tar.bz2
ghdl-13fd5ccc6a8b9e59212b5493eb319c6f932eb906.zip
Merge remote-tracking branch 'github-umarcor/py/GHDL' into paebbels/pyGHDL
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/pyunit/testsuite.sh53
-rwxr-xr-xtestsuite/testsuite.sh27
2 files changed, 24 insertions, 56 deletions
diff --git a/testsuite/pyunit/testsuite.sh b/testsuite/pyunit/testsuite.sh
deleted file mode 100644
index 12b367f2c..000000000
--- a/testsuite/pyunit/testsuite.sh
+++ /dev/null
@@ -1,53 +0,0 @@
-#! /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
diff --git a/testsuite/testsuite.sh b/testsuite/testsuite.sh
index fd686ccd0..b77ccdbc5 100755
--- a/testsuite/testsuite.sh
+++ b/testsuite/testsuite.sh
@@ -112,7 +112,7 @@ do_sanity () {
[ "$failures" = "" ] || exit 1
}
-# The GNA testsuite: regression testsuite using reports/issues from gna.org
+# The GNA testsuite: regression testsuite using reports/issues from gna.org and from GitHub
do_gna () {
gstart "[GHDL - test] gna"
cd gna
@@ -138,6 +138,26 @@ do_gna () {
[ "$failures" = "" ] || exit 1
}
+# The Python Unit testsuite: regression testsuite for Python bindings to libghdl
+do_pyunit () {
+ gstart "[GHDL - test] pyunit"
+ cd pyunit
+
+ dirs=`./testsuite.sh --list-tests`
+ if ./testsuite.sh > test.log 2>&1 ; then
+ printf "pyunit: ${ANSI_GREEN}ok${ANSI_NOCOLOR}\n"
+ # Don't disp log
+ else
+ printf "pyunit: ${ANSI_RED}failed${ANSI_NOCOLOR}\n"
+ cat test.log
+ failures="$failures"
+ fi
+
+ cd ..
+ gend
+ [ "$failures" = "" ] || exit 1
+}
+
# The VESTS testsuite: compliance testsuite, from: https://github.com/nickg/vests.git 388250486a
do_vests () {
gstart "[GHDL - test] vests"
@@ -226,7 +246,7 @@ for opt; do
esac
done
-if [ "x$tests" = "x" ]; then tests="sanity gna vests synth vpi"; fi
+if [ "x$tests" = "x" ]; then tests="sanity pyunit gna vests synth vpi"; fi
echo "tests: $tests"
@@ -234,10 +254,11 @@ echo "tests: $tests"
do_test() {
case $1 in
sanity) do_sanity;;
+ pyunit) do_pyunit;;
gna) do_gna;;
vests) do_vests;;
synth) do_synth;;
- vpi) do_vpi;;
+ vpi) do_vpi;;
*)
printf "${ANSI_RED}$0: test name '$1' is unknown${ANSI_NOCOLOR}\n"
exit 1;;