Skip to content
Snippets Groups Projects
Commit 355eea01 authored by Francois-Rene Rideau's avatar Francois-Rene Rideau
Browse files

Fix allegro/windows to not create console for batch,

by making run-tests.sh aware of batch vs interactive invocations.
parent 7743749c
No related branches found
No related tags found
No related merge requests found
...@@ -88,13 +88,13 @@ do_tests () { ...@@ -88,13 +88,13 @@ do_tests () {
## We go through great lengths to avoid " in the command line, ## We go through great lengths to avoid " in the command line,
## the quoting of which some Windows implementations get wrong. ## the quoting of which some Windows implementations get wrong.
## While we're at it, we also avoid spaces and backslashes. ## While we're at it, we also avoid spaces and backslashes.
( cd .. && DO $cmd $debugp $eval '(or #.(load(string`|test/script-support.lisp|))#.(asdf-test::compile-asdf-script))' ) ( cd .. && DO $bcmd $eval '(or #.(load(string`|test/script-support.lisp|))#.(asdf-test::compile-asdf-script))' )
if [ $? -ne 0 ] ; then if [ $? -ne 0 ] ; then
echo "Compilation FAILED" >&2 echo "Compilation FAILED" >&2
echo "you can retry compilation with:" >&2 echo "you can retry compilation with:" >&2
echo ./test/run-tests.sh $lisp >&2 echo ./test/run-tests.sh $lisp >&2
echo "or more interactively (and maybe with rlwrap or in emacs), start with:" >&2 echo "or more interactively (and maybe with rlwrap or in emacs), start with:" >&2
echo "$cmd" >&2 echo "$icmd" >&2
echo "then copy/paste:" >&2 echo "then copy/paste:" >&2
echo '(load "test/script-support.lisp") (asdf-test::compile-asdf-script)' >&2 echo '(load "test/script-support.lisp") (asdf-test::compile-asdf-script)' >&2
else else
...@@ -108,7 +108,7 @@ do_tests () { ...@@ -108,7 +108,7 @@ do_tests () {
echo "Testing: $i" >&2 echo "Testing: $i" >&2
test_count=`expr "$test_count" + 1` test_count=`expr "$test_count" + 1`
rm -f ~/.cache/common-lisp/"`pwd`"/* || true rm -f ~/.cache/common-lisp/"`pwd`"/* || true
if DO $cmd $debugp $eval "'(#.(load(string'|script-support.lisp|))#.(asdf-test::load-asdf)#.(asdf-test::frob-packages)#.(asdf-test::with-test()(load(string'|$i|))))" ; then if DO $bcmd $eval "'(#.(load(string'|script-support.lisp|))#.(asdf-test::load-asdf)#.(asdf-test::frob-packages)#.(asdf-test::with-test()(load(string'|$i|))))" ; then
echo "Using $command, $i passed" >&2 echo "Using $command, $i passed" >&2
test_pass=`expr "$test_pass" + 1` test_pass=`expr "$test_pass" + 1`
else else
...@@ -118,7 +118,7 @@ do_tests () { ...@@ -118,7 +118,7 @@ do_tests () {
echo "you can retry compilation with:" >&2 echo "you can retry compilation with:" >&2
echo ./test/run-tests.sh $lisp $i >&2 echo ./test/run-tests.sh $lisp $i >&2
echo "or more interactively (and maybe with rlwrap or in emacs), start with:" >&2 echo "or more interactively (and maybe with rlwrap or in emacs), start with:" >&2
echo "(cd test ; $cmd )" >&2 echo "(cd test ; $icmd )" >&2
echo "then copy/paste:" >&2 echo "then copy/paste:" >&2
echo "'(#.(load \"script-support.lisp\") #.(asdf-test::da) #.(load-asdf) #.(frob-packages) #.(load \"$i\"))" >&2 echo "'(#.(load \"script-support.lisp\") #.(asdf-test::da) #.(load-asdf) #.(frob-packages) #.(load \"$i\"))" >&2
fi fi
...@@ -149,23 +149,24 @@ esac ...@@ -149,23 +149,24 @@ esac
# terminate on error # terminate on error
set -e set -e
command= flags= nodebug= eval= command= flags= nodebug= eval= bcmd= icmd=
case "$lisp" in case "$lisp" in
abcl) abcl)
command="${ABCL:-abcl}" command="${ABCL:-abcl}"
flags="--noinit --nosystem --noinform" flags="--noinit --nosystem --noinform"
eval="--eval" ;; eval="--eval"
;;
allegro) allegro)
command="${ALLEGRO:-alisp}" command="${ALLEGRO:-alisp}"
flags="-q" flags="-q"
nodebug="-batch" nodebug="-batch"
if [ "$os" = windows ] ; then nodebug="$nodebug +c" ; fi if [ "$os" = windows ] ; then bcmd="$command +c $flags" ; fi
eval="-e" ;; eval="-e" ;;
allegromodern) allegromodern)
command="${ALLEGROMODERN:-mlisp}" command="${ALLEGROMODERN:-mlisp}"
if [ "$os" = windows ] ; then bcmd="$command +c $flags" ; fi
flags="-q" flags="-q"
nodebug="-batch" nodebug="-batch"
if [ "$os" = windows ] ; then nodebug="$nodebug +c" ; fi
eval="-e" ;; eval="-e" ;;
ccl) ccl)
command="${CCL:-ccl}" command="${CCL:-ccl}"
...@@ -240,11 +241,9 @@ if ! type "$command" > /dev/null ; then ...@@ -240,11 +241,9 @@ if ! type "$command" > /dev/null ; then
fi fi
ASDFDIR="$(cd $(dirname $0)/.. ; /bin/pwd)" ASDFDIR="$(cd $(dirname $0)/.. ; /bin/pwd)"
: ${bcmd:=$command $flags} ${icmd:=$command $flags} # batch and interactive
cmd="$command $flags"
debugp=
if [ -z "${DEBUG_ASDF_TEST}" ] ; then if [ -z "${DEBUG_ASDF_TEST}" ] ; then
debugp="$nodebug" bcmd="$bcmd $nodebug"
fi fi
...@@ -368,13 +367,13 @@ run_upgrade_tests () { ...@@ -368,13 +367,13 @@ run_upgrade_tests () {
if valid_upgrade_test_p $lisp $tag $method ; then if valid_upgrade_test_p $lisp $tag $method ; then
echo "Testing ASDF upgrade from ${tag} using method $method" echo "Testing ASDF upgrade from ${tag} using method $method"
extract_tagged_asdf $tag extract_tagged_asdf $tag
$cmd $debugp $eval \ $bcmd $eval \
"'(#.(load(string'|$su|))#.#.\`(in-package,:asdf-test)#.(test-upgrade$method\`|$tag|))" || "'(#.(load(string'|$su|))#.#.\`(in-package,:asdf-test)#.(test-upgrade$method\`|$tag|))" ||
{ echo "upgrade FAILED for $lisp from $tag using method $method" ; { echo "upgrade FAILED for $lisp from $tag using method $method" ;
echo "you can retry just that test with:" ; echo "you can retry just that test with:" ;
echo ASDF_UPGRADE_TEST_TAGS=\"$tag\" ASDF_UPGRADE_TEST_METHODS=\"$method\" ./test/run-tests.sh -u $lisp ; echo ASDF_UPGRADE_TEST_TAGS=\"$tag\" ASDF_UPGRADE_TEST_METHODS=\"$method\" ./test/run-tests.sh -u $lisp ;
echo "or more interactively (and maybe with rlwrap or in emacs), start with:" echo "or more interactively (and maybe with rlwrap or in emacs), start with:"
echo "$cmd" echo "$icmd"
echo "then copy/paste:" echo "then copy/paste:"
echo "(load \"$su\") (asdf-test::da) (test-upgrade $method \"$tag\")" echo "(load \"$su\") (asdf-test::da) (test-upgrade $method \"$tag\")"
exit 1 ;} exit 1 ;}
...@@ -408,10 +407,10 @@ test_clean_load () { ...@@ -408,10 +407,10 @@ test_clean_load () {
mkdir -p build/results/ mkdir -p build/results/
nop=build/results/${lisp}-nop.text nop=build/results/${lisp}-nop.text
load=build/results/${lisp}-load.text load=build/results/${lisp}-load.text
$cmd $eval \ $bcmd $eval \
'(or`#.(load(string`|test/script-support.lisp|)`:verbose():print())#.(asdf-test::exit-lisp`0))' \ '(or`#.(load(string`|test/script-support.lisp|)`:verbose():print())#.(asdf-test::exit-lisp`0))' \
> $nop 2>&1 > $nop 2>&1
$cmd $eval \ $bcmd $eval \
'(or`#.(load(string`|test/script-support.lisp|)`:verbose`():print`())#.(asdf-test::verbose())#.(load(string`|build/asdf.lisp|):verbose())#.(asdf/image:quit`0))' \ '(or`#.(load(string`|test/script-support.lisp|)`:verbose`():print`())#.(asdf-test::verbose())#.(load(string`|build/asdf.lisp|):verbose())#.(asdf/image:quit`0))' \
> $load 2>&1 > $load 2>&1
if diff $nop $load ; then if diff $nop $load ; then
...@@ -427,17 +426,17 @@ test_load_systems () { ...@@ -427,17 +426,17 @@ test_load_systems () {
cd ${ASDFDIR} cd ${ASDFDIR}
mkdir -p build/results/ mkdir -p build/results/
echo "Loading all these systems: $*" echo "Loading all these systems: $*"
$cmd $eval \ $bcmd $eval \
"(or #.(load(string'|test/script-support.lisp|))#.(asdf-test::with-test()(asdf-test::test-load-systems $*)))" \ "(or #.(load(string'|test/script-support.lisp|))#.(asdf-test::with-test()(asdf-test::test-load-systems $*)))" \
2>&1 | tee build/results/${lisp}-systems.text 2>&1 | tee build/results/${lisp}-systems.text
} }
test_interactively () { test_interactively () {
cd ${ASDFDIR} cd ${ASDFDIR}
mkdir -p build/results/ mkdir -p build/results/
rlwrap $cmd $eval "(or'#.(load(string'|test/script-support.lisp|))#.(asdf-test::interactive-test'($*)))" rlwrap $icmd $eval "(or'#.(load(string'|test/script-support.lisp|))#.(asdf-test::interactive-test'($*)))"
} }
if [ -z "$cmd" ] ; then if [ -z "$command" ] ; then
echo "Error: cannot find or do not know how to run Lisp named $lisp" echo "Error: cannot find or do not know how to run Lisp named $lisp"
elif [ -n "$test_interactively" ] ; then elif [ -n "$test_interactively" ] ; then
test_interactively "$@" test_interactively "$@"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment