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

Tweak test infrastructure so it survives buggy parameter passing on Allegro/Windows.

parent aeab911e
No related branches found
No related tags found
No related merge requests found
...@@ -85,7 +85,10 @@ do_tests () { ...@@ -85,7 +85,10 @@ do_tests () {
fi fi
env | grep -i asdf env | grep -i asdf
rm -f ~/.cache/common-lisp/"`pwd`"/* || true rm -f ~/.cache/common-lisp/"`pwd`"/* || true
( cd .. && DO $cmd $debugp $eval '(or #.(load "test/script-support.lisp") #.(asdf-test::compile-asdf-script))' ) ## We go through great lengths to avoid " in the command line,
## the quoting of which some Windows implementations get wrong.
## 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))' )
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
...@@ -105,7 +108,7 @@ do_tests () { ...@@ -105,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 \"script-support.lisp\")" $eval "(progn (asdf-test::load-asdf) (asdf-test::frob-packages) (asdf-test::with-test () (load \"$i\")))" ; then if DO $cmd $debugp $eval "(load(string'|script-support.lisp|))" $eval "(progn(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
...@@ -359,14 +362,14 @@ run_upgrade_tests () { ...@@ -359,14 +362,14 @@ run_upgrade_tests () {
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 \ $cmd $debugp $eval \
"'(#.(load\"$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 "$cmd"
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 ;}
fi ; done ; done 2>&1 | tee build/results/${lisp}-upgrade.text fi ; done ; done 2>&1 | tee build/results/${lisp}-upgrade.text
} }
...@@ -398,11 +401,11 @@ test_clean_load () { ...@@ -398,11 +401,11 @@ 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} \ $cmd $eval \
'(or #.(load "test/script-support.lisp" :verbose nil :print nil) #.(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} \ $cmd $eval \
'(or #.(load "test/script-support.lisp" :verbose nil :print nil) #.(asdf-test::verbose nil) #.(load "build/asdf.lisp" :verbose nil) #.(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
echo "GOOD: Loading ASDF on $lisp produces no message" >&2 ; return 0 echo "GOOD: Loading ASDF on $lisp produces no message" >&2 ; return 0
...@@ -417,14 +420,14 @@ test_load_systems () { ...@@ -417,14 +420,14 @@ 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} \ $cmd $eval \
"(or #.(load \"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 \"test/script-support.lisp\") #.(asdf-test::interactive-test '($*)))" rlwrap $cmd $eval "(or'#.(load(string'|test/script-support.lisp|))#.(asdf-test::interactive-test'($*)))"
} }
if [ -z "$cmd" ] ; then if [ -z "$cmd" ] ; then
......
...@@ -576,6 +576,7 @@ is bound, write a message and exit on an error. If ...@@ -576,6 +576,7 @@ is bound, write a message and exit on an error. If
(defun test-upgrade (old-method new-method tag) ;; called by run-test (defun test-upgrade (old-method new-method tag) ;; called by run-test
(with-test () (with-test ()
(verbose t nil) (verbose t nil)
(setf tag (string tag))
(when old-method (when old-method
(cond (cond
((string-equal tag "REQUIRE") ((string-equal tag "REQUIRE")
......
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