# -*- shell-script -*-
#
# all.gam - the test file that calls all the rest.
#
# Copyright (C) 1998, Phil Maker, <pjm@gnu.org>, Quoll Systems Pty Ltd.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# $Id: all.gam,v 1.1.1.1 1999/09/12 03:26:50 pjm Exp $
#

echo "
	    Gammon test for $PACKAGE-$VERSION

This is a first release of the new test system and will probably 
have a few problems. After its fixed up the intent is to release it
as a simple test program under the GPL.

"

compile <<EOF
cat \$1-header \$1-source \$1-footer >\$1-source.c
\$COMPILER \$CFLAGS -I$top_srcdir/src \$1-source.c -L../src -lnana -o \$1.out
EOF

checktrue () {
    expect <<EOF
1
EOF
    source "$*"
}

checkfalse () {
    expect <<EOF
0
EOF
    source "$*"
}

checkempty () {
    expect <<EOF
EOF
    source "$*"
}

checkfail () {
    expect <<EOF
fail
EOF
    source "$*"
}


for COMPILER in $CC $CXX
do
    export COMPILER
    echo "
* Testing using the $COMPILER compiler
"
    
    . $src_dir/I.gam
    . $src_dir/Q.gam
done


