... |
... |
@@ -6,7 +6,8 @@ |
6
|
6
|
# then just those tests are run.
|
7
|
7
|
|
8
|
8
|
usage() {
|
9
|
|
- echo "run-tests.sh [?] [-l lisp] [tests]"
|
|
9
|
+ echo "run-tests.sh [?] [-d test-dir] [-l lisp] [tests]"
|
|
10
|
+ echo " -d test-dir Directory containing the unit test files"
|
10
|
11
|
echo " -l lisp Lisp to use for the tests; defaults to lisp"
|
11
|
12
|
echo " -? This help message"
|
12
|
13
|
echo ""
|
... |
... |
@@ -23,10 +24,11 @@ usage() { |
23
|
24
|
}
|
24
|
25
|
|
25
|
26
|
LISP=lisp
|
26
|
|
-while getopts "h?l:" arg
|
|
27
|
+while getopts "h?l:d:" arg
|
27
|
28
|
do
|
28
|
29
|
case $arg in
|
29
|
30
|
l) LISP=$OPTARG ;;
|
|
31
|
+ d) TESTDIR=$OPTARG ;;
|
30
|
32
|
\?) usage ;;
|
31
|
33
|
esac
|
32
|
34
|
done
|
... |
... |
@@ -50,11 +52,18 @@ trap cleanup EXIT |
50
|
52
|
# Compile up the C file that is used for testing alien funcalls to
|
51
|
53
|
# functions that return integer types of different lengths. We use
|
52
|
54
|
# gcc since clang isn't always available.
|
53
|
|
-(cd tests; gcc -m32 -O3 -c test-return.c)
|
|
55
|
+(cd $TESTDIR; gcc -m32 -O3 -c test-return.c)
|
54
|
56
|
|
55
|
57
|
if [ $# -eq 0 ]; then
|
|
58
|
+ # Test directory arg for run-all-tests if a non-default
|
|
59
|
+ if [ -n ${TESTDIR} ]; then
|
|
60
|
+ TESTDIRARG=" :test-directory \"${TESTDIR}/\""
|
|
61
|
+ else
|
|
62
|
+ TESTDIR="tests/"
|
|
63
|
+ TESTDIRARG=""
|
|
64
|
+ fi
|
56
|
65
|
# No args so run all the tests
|
57
|
|
- $LISP -nositeinit -noinit -load tests/run-tests.lisp -eval '(cmucl-test-runner:run-all-tests)'
|
|
66
|
+ $LISP -nositeinit -noinit -load $TESTDIR/run-tests.lisp -eval "(cmucl-test-runner:run-all-tests ${TESTDIRARG})"
|
58
|
67
|
else
|
59
|
68
|
# Run selected files. Convert each file name to uppercase and append "-TESTS"
|
60
|
69
|
result=""
|
... |
... |
@@ -63,6 +72,6 @@ else |
63
|
72
|
new=`echo $f | tr '[a-z]' '[A-Z]'`
|
64
|
73
|
result="$result "\"$new-TESTS\"
|
65
|
74
|
done
|
66
|
|
- $LISP -nositeinit -noinit -load tests/run-tests.lisp -eval "(progn (cmucl-test-runner:load-test-files) (cmucl-test-runner:run-test $result))"
|
|
75
|
+ $LISP -nositeinit -noinit -load $TESTDIR/run-tests.lisp -eval "(progn (cmucl-test-runner:load-test-files) (cmucl-test-runner:run-test $result))"
|
67
|
76
|
fi
|
68
|
77
|
|