fix -xchibi.primitive and spurious output in snow-chibi (thanks Martin Hayman)

This commit is contained in:
Alex Shinn 2018-12-28 23:29:13 +08:00
parent 264cbc756f
commit 43d6d20598
4 changed files with 7 additions and 5 deletions

1
main.c
View file

@ -362,6 +362,7 @@ sexp run_main (int argc, char **argv) {
arg = ((argv[i][2] == '\0') ? argv[++i] : argv[i]+2);
if (c == 'x') {
if (strcmp(arg, "chibi.primitive") == 0) {
argv[i][2] = '\0';
goto load_primitive;
} else if (strcmp(arg, "scheme.small") == 0) {
load_init(0);

View file

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
# Test chibi-scheme command-line options.
# Should be run from a standard build.
@ -12,13 +12,14 @@ run_chibi() {
}
for t in $TESTDIR/*.args; do
IFS=$'\r\n' GLOBIGNORE='*' :; args=($(cat $t))
run_chibi ${args[@]} 2> ${t%.args}.err > ${t%.args}.out
IFS=$'\n' read -d '' -r -a args < $t
run_chibi "${args[@]}" 2> ${t%.args}.err > ${t%.args}.out
if diff -w -q ${t%.args}.out ${t%.args}.res \
&& ([ ! -e ${t%.args}.err-res ] || \
diff -w -q ${t%.args}.err ${t%.args}.err-res); then
echo "[PASS] $(basename ${t%.args})"
else
echo chibi "${args[@]}"
echo "[FAIL] $(basename ${t%.args})"
FAILURES=$((FAILURES + 1))
fi

View file

@ -1,2 +1,2 @@
-x(chibi primitive)
-xchibi.primitive
-p(+ 2 2)

View file

@ -2,7 +2,7 @@
CHIBI=${CHIBI:-chibi-scheme}
IMG=-isnow.img
if [ -x ./chibi-scheme ] && ! type $CHIBI 2>/dev/null; then
if [ -x ./chibi-scheme ] && ! type $CHIBI >/dev/null 2>/dev/null; then
# convenience for running from dev, notable "make test-snow"
CHIBI="./chibi-scheme"
export LD_LIBRARY_PATH=".:${LD_LIBRARY_PATH}"