File: test.sh

package info (click to toggle)
araneida 0.90.1-dfsg-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 700 kB
  • ctags: 643
  • sloc: lisp: 4,878; perl: 166; sh: 109; makefile: 34
file content (43 lines) | stat: -rw-r--r-- 1,545 bytes parent folder | download | duplicates (2)
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
#!/bin/bash
SBCL=sbcl
CMUCL=cmucl

# The test program has a unique string that it is supposed to produce and look for
# to make sure that we are not dealing with a stale server.
# Not that that's ever happened to me...twice....
randomtext=${RANDOM}${RANDOM}${RANDOM}${RANDOM} # I make it long-ish so as to make it improbable to find naturally

# In order to add a new lisp to the test suite, you need to alter 3 areas in test-server.lisp
#    - Add any backtrace information you want to *invoke-debugger-hook*
#    - Alter GET-RANDOM-TEXT to properly get the random text from the command line
#    - Below :testend add a quit function, or whatever will make your lisp properly terminate
#
# Then add the proper call to the case statement below.
#
# I believe the test suite will work fine for both threaded and non-threaded servers,
# but YMMV.

case "$1" in
    sbcl)
	echo "Running test suite for SBCL."
	$SBCL --noprint --load "test-server.lisp" --end-toplevel-options "$randomtext" > /dev/null &
	sleep 15
	;;
    sbcl-serve-event)
	# force use of serve-event, not threads
	echo "Running test suite for SBCL (force serve-event)."
	$SBCL --noprint --load "test-server.lisp" --end-toplevel-options "$randomtext" "serve-event" > /dev/null &
	sleep 15
	;;
    cmucl)
	echo "Running test suite for CMUCL."
	$CMUCL -quiet -load "test-server.lisp" "$randomtext" > /dev/null &
	sleep 10
	;;
    *)
	echo "Usage: sh test.sh [lisp name]"
	echo "I currently know about: sbcl sbcl-serve-event cmucl"
	exit 1
esac
perl test-server-walker.pl $randomtext