Make test toplevel.sh usable
authorDavid Lichteblau <david@lichteblau.com>
Tue, 9 Aug 2011 14:45:10 +0000 (16:45 +0200)
committerDavid Lichteblau <david@lichteblau.com>
Tue, 9 Aug 2011 14:50:43 +0000 (16:50 +0200)
  Move toplevel.sh to toplevel.test.sh (where run-tests.sh expects it).

  Move one of the tests to script.test.sh (where needed helper files
  are set up).

tests/script.test.sh
tests/toplevel.sh [deleted file]
tests/toplevel.test.sh [new file with mode: 0644]

index e17761a..19fcc5f 100644 (file)
@@ -76,6 +76,17 @@ then
     exit $EXIT_LOSE
 fi
 
+# --script
+cat > $tmpscript <<EOF
+(print :script-ok)
+EOF
+run_sbcl --script $tmpscript --eval foo \
+  < /dev/null > $tmpout
+if [ "`grep -c :SCRIPT-OK $tmpout`" != 1 ] ; then
+   echo "failed --script test using PRINT"
+   exit $EXIT_LOSE
+fi
+
 rm -f $tmpscript $tmpout $tmperr
 
 exit $EXIT_TEST_WIN
diff --git a/tests/toplevel.sh b/tests/toplevel.sh
deleted file mode 100644 (file)
index f7e055b..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/sh
-
-# tests related to the toplevel interface: command line parsing
-# and outer REPL
-
-# This software is part of the SBCL system. See the README file for
-# more information.
-#
-# While most of SBCL is derived from the CMU CL system, the test
-# files (like this one) were written from scratch after the fork
-# from CMU CL.
-#
-# This software is in the public domain and is provided with
-# absolutely no warranty. See the COPYING and CREDITS files for
-# more information.
-
-. ./subr.sh
-
-use_test_subdirectory
-
-# Until sbcl-0.pre8, all --eval arguments were parsed before any of
-# them were executed, making it impossible for --eval forms to refer
-# to packages created by --eval forms.
-run_sbcl --eval "(defpackage :foo)" --eval "(print 'foo::bar)" \
-  < /dev/null > $TEST_FILESTEM
-if [ "`grep -c FOO::BAR $TEST_FILESTEM`" != 1 ] ; then
-    echo failed DEFPACKAGE-then-PRINT from --eval form
-    exit $EXIT_LOSE
-fi
-
-# --script
-run_sbcl --script script-test.lisp --eval foo \
-  < /dev/null > $TEST_FILESTEM
-if [ "`grep -c :SCRIPT-OK $TEST_FILESTEM`" != 1 ] ; then
-   echo "failed --script test"
-   exit $EXIT_LOSE
-fi
-exit $EXIT_TEST_WIN
diff --git a/tests/toplevel.test.sh b/tests/toplevel.test.sh
new file mode 100644 (file)
index 0000000..1103354
--- /dev/null
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+# tests related to the toplevel interface: command line parsing
+# and outer REPL
+
+# This software is part of the SBCL system. See the README file for
+# more information.
+#
+# While most of SBCL is derived from the CMU CL system, the test
+# files (like this one) were written from scratch after the fork
+# from CMU CL.
+#
+# This software is in the public domain and is provided with
+# absolutely no warranty. See the COPYING and CREDITS files for
+# more information.
+
+. ./subr.sh
+
+use_test_subdirectory
+
+# Until sbcl-0.pre8, all --eval arguments were parsed before any of
+# them were executed, making it impossible for --eval forms to refer
+# to packages created by --eval forms.
+run_sbcl --eval "(defpackage :foo)" --eval "(print 'foo::bar)" \
+  < /dev/null > $TEST_FILESTEM
+if [ "`grep -c FOO::BAR $TEST_FILESTEM`" != 1 ] ; then
+    echo failed DEFPACKAGE-then-PRINT from --eval form
+    exit $EXIT_LOSE
+fi
+
+exit $EXIT_TEST_WIN