* Forgot to add the file check-guile.in with the latest commit.
[bpt/guile.git] / check-guile.in
1 #! /bin/sh
2 # Usage: check-guile [-i GUILE-INTERPRETER] [GUILE-TEST-ARGS]
3 # If `-i GUILE-INTERPRETER' is omitted, use libguile/guile.
4 # See test-suite/guile-test for documentation on GUILE-TEST-ARGS.
5 #
6 # Example invocations:
7 # ./check-guile
8 # ./check-guile numbers.test
9 # ./check-guile -i /usr/local/bin/guile
10 # ./check-guile -i /usr/local/bin/guile numbers.test
11 #
12 # Dependencies: dirname sed
13
14 TEST_SUITE_DIR=@test_suite_dir@
15 parent=`dirname $TEST_SUITE_DIR`
16
17 if [ x"$1" = x-i ] ; then
18 guile=$2
19 shift
20 shift
21 else
22 guile=$parent/libguile/guile
23 glp=$parent
24 fi
25
26 if [ -f "$guile" -a -x "$guile" ] ; then
27 echo Testing $guile ... "$@"
28 if [ x"$glp" = x ] ; then
29 glp=`$guile -c "(for-each write-line %load-path)"`
30 glp=`echo $glp | sed 's/ /:/g'`:$parent
31 fi
32 GUILE_LOAD_PATH=$glp
33 export GUILE_LOAD_PATH
34 echo with GUILE_LOAD_PATH: $GUILE_LOAD_PATH
35 else
36 echo ERROR: Cannot execute $guile
37 exit 1
38 fi
39
40 cd $TEST_SUITE_DIR
41 exec $guile -e main -s guile-test --test-suite $TEST_SUITE_DIR/tests "$@"
42
43 # check-guile ends here