summaryrefslogtreecommitdiff
path: root/testsuite/gna/testsuite.sh
blob: f4240a058d3dd1c28ba6cb9e9ba86b4c3cd51759 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#! /bin/sh

# Driver for the GNA testsuite.
# Each test correspond to one report, and is put in one directory (using
# the support/bug number)
#
# bugXXX is for bugs reported on https://gna.org/bugs/?group=ghdl
# srXXX is for support reported on https://gna.org/support/?group=ghdl
# debXX is for bugs report on http://bugs.debian.org/
# ticketXX is from https://sourceforge.net/p/ghdl-updates/tickets/

set -e

dirs="bug* sr* deb* ticket*"
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" ;;
  *) echo "Unknown option $opt"
     exit 2
     ;;
  esac
done

for i in $dirs; do
  echo "GNA dir $i:"
  cd $i
  if ! ./testsuite.sh; then
    if [ $full = "y" ]; then
      failures="$failures $i"
    else
      exit 1;
    fi
  fi
  cd ..
done

if [ x"$failures" = x"" ]; then
    echo "GNA tests are successful"
    exit 0
else
    echo "GNA test failed ($failures)"
    exit 1
fi