#!/bin/sh
# ----------------------------------------------------------------------------
# - aleph-xtest                                                              -
# - aleph interpreter test execution script with librarian                   -
# ----------------------------------------------------------------------------
# - This program is  free software;  you can  redistribute it and/or  modify -
# - it provided that this copyright notice is kept intact.                   -
# -                                                                          -
# - 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. In not event shall -
# - the copyright holder be  liable for  any direct, indirect, incidental or -
# - special damages arising in any way out of the use of this software.      -
# ----------------------------------------------------------------------------
# - copyright (c) 1999-2001 amaury darsch                                    -
# ----------------------------------------------------------------------------

BLDDIR=$1
BLDBIN=$1/bin
BLDLIB=$1/lib:$LD_LIBRARY_PATH
XLFLAG="-s -f $2"
AIFLAG="-f assert -i $2"
XLEXEC="$BLDBIN/axl   $XLFLAG"
AIEXEC="$BLDBIN/aleph $AIFLAG"

AXLALS=`LD_LIBRARY_PATH=$BLDLIB $XLEXEC`
for f in $AXLALS; do
    echo "testing: $f"
    LD_LIBRARY_PATH=$BLDLIB $AIEXEC $f
    if [ "$?" != "0" ]; then
	echo "failure: $f"
	exit 1
    fi
done
exit 0
