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 54
|
#!/bin/sh
#
# Drizzle Client Library
#
# Copyright (C) 2008 Eric Day (eday@oddments.org)
# All rights reserved.
#
# Use and distribution licensed under the BSD license. See
# the COPYING file in this directory for full text.
#
# Get filename we want to run without path
name=`echo $1 | sed 's/.*\/\([^\/]*\)$/\1/'`
ext=`echo $name | sed 's/.*\.\([^.]*$\)/\1/'`
if [ "x$ext" = "x$name" ]
then
ext=""
fi
if [ ! "x$ext" = "xsh" ]
then
libtool_prefix="libtool --mode=execute"
fi
# Set prefix if it was given through environment
if [ -n "$LIBDRIZZLE_TEST_PREFIX" ]
then
if [ -n "$LIBDRIZZLE_TEST_FILTER" ]
then
# If filter variable is set, only apply prefix to those that match
for x in $LIBDRIZZLE_TEST_FILTER
do
if [ "x$x" = "x$name" ]
then
prefix="$libtool_prefix $LIBDRIZZLE_TEST_PREFIX"
with=" (with prefix after filter)"
break
fi
done
else
prefix="$libtool_prefix $LIBDRIZZLE_TEST_PREFIX"
with=" (with prefix)"
fi
fi
# Set this to fix broken libtool test
ECHO=`which echo`
export ECHO
echo
echo "RUN: $name$with"
(cd tests && $prefix ./$name)
|