Commit | Line | Data |
---|---|---|
8992c8a2 DH |
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 | ||
51cfd7da GH |
14 | TEST_SUITE_DIR=@srcdir@/test-suite |
15 | parent=@srcdir@ | |
16 | build_dir=`pwd` | |
8992c8a2 DH |
17 | |
18 | if [ x"$1" = x-i ] ; then | |
19 | guile=$2 | |
20 | shift | |
21 | shift | |
51cfd7da | 22 | glp= |
8992c8a2 | 23 | else |
51cfd7da | 24 | guile=$build_dir/libguile/guile |
8992c8a2 DH |
25 | glp=$parent |
26 | fi | |
27 | ||
28 | if [ -f "$guile" -a -x "$guile" ] ; then | |
29 | echo Testing $guile ... "$@" | |
30 | if [ x"$glp" = x ] ; then | |
31 | glp=`$guile -c "(for-each write-line %load-path)"` | |
32 | glp=`echo $glp | sed 's/ /:/g'`:$parent | |
33 | fi | |
34 | GUILE_LOAD_PATH=$glp | |
35 | export GUILE_LOAD_PATH | |
36 | echo with GUILE_LOAD_PATH: $GUILE_LOAD_PATH | |
37 | else | |
38 | echo ERROR: Cannot execute $guile | |
39 | exit 1 | |
40 | fi | |
41 | ||
42 | cd $TEST_SUITE_DIR | |
51cfd7da | 43 | exec $guile -e main -s guile-test --test-suite $TEST_SUITE_DIR/tests --log-file $build_dir/check-guile.log "$@" |
8992c8a2 DH |
44 | |
45 | # check-guile ends here |