From 960380abbfd6b4986915247198f6c8b3576362cb Mon Sep 17 00:00:00 2001 From: michelou Date: Tue, 9 May 2006 14:59:37 +0000 Subject: fixed error in file templates/generic-unix.tmpl added corresponding test in script file test/clitest --- src/compiler/scala/tools/ant/templates/generic-unix.tmpl | 2 +- test/clitest | 11 ++++++++--- test/files/cli/test1/Main.check.java5 | 7 ++++--- test/files/cli/test1/Main.check.scala | 7 ++++--- test/files/cli/test1/Main.check.scalac | 3 ++- test/files/cli/test1/Main.check.scalaint | 7 ++++--- test/files/cli/test1/Main.java | 2 +- test/files/cli/test1/Main.scala | 2 +- test/files/cli/test2/Main.check.java5 | 7 ++++--- test/files/cli/test2/Main.check.scala | 7 ++++--- test/files/cli/test2/Main.check.scalac | 3 ++- test/files/cli/test2/Main.check.scalaint | 9 +++++---- test/files/cli/test3/Main.check.java5 | 14 ++++++++------ test/files/cli/test3/Main.check.scala | 14 ++++++++------ test/files/cli/test3/Main.check.scalac | 3 ++- test/files/cli/test3/Main.check.scalaint | 15 ++++++++------- 16 files changed, 66 insertions(+), 47 deletions(-) diff --git a/src/compiler/scala/tools/ant/templates/generic-unix.tmpl b/src/compiler/scala/tools/ant/templates/generic-unix.tmpl index f34e8edc88..fffc0b3e9f 100644 --- a/src/compiler/scala/tools/ant/templates/generic-unix.tmpl +++ b/src/compiler/scala/tools/ant/templates/generic-unix.tmpl @@ -55,7 +55,7 @@ for i in "$@@" ; do USER_CLASSPATH=$i QQ_CP_ARGUMENT=0 else - if [ $i = "-cp" ] || [ $i = "-classpath" ] ; then + if [ "$i" = "-cp" ] || [ "$i" = "-classpath" ] ; then QQ_CP_ARGUMENT=1 else USER_ARGS="$USER_ARGS $i" diff --git a/test/clitest b/test/clitest index 4d21fc638c..5da82f7463 100755 --- a/test/clitest +++ b/test/clitest @@ -199,7 +199,12 @@ test_execute() { printf "Execute $main with current directory as default classpath\\n" test_run "(cd $OUTPUT_DIR && - env CLASSPATH= $RUNTIME_COMMAND $main 3 2>> $LOG_FILE 1>> $LOG_FILE)"; + env CLASSPATH= $RUNTIME_COMMAND $main 3 2>> $LOG_FILE 1>> $LOG_FILE)"; + + printf "Execute $main with quoted argument\\n" + test_run "env CLASSPATH= \ + $RUNTIME_COMMAND -classpath $OUTPUT_DIR $main 4 \"a b c\" \ + 2>> $LOG_FILE 1>> $LOG_FILE"; test_diff "$check$suffix" "$LOG_FILE"; } @@ -331,8 +336,8 @@ elif [ "$LANG" = "java" ]; then else abort "unknown language '$LANG'" fi -[ -x "$COMPILER_COMMAND" ] || ( printf "Command $COMPILER_COMMAND not found\\n"; exit 1 ); -[ -x "$RUNTIME_COMMAND" ] || ( printf "Command $RUNTIME_COMMAND not found\\n"; exit 1 ); +[ -x "$COMPILER_COMMAND" ] || abort "Command $COMPILER_COMMAND not found"; +[ -x "$RUNTIME_COMMAND" ] || abort "Command $RUNTIME_COMMAND not found"; printf_initialization "${COLOR:-many}"; diff --git a/test/files/cli/test1/Main.check.java5 b/test/files/cli/test1/Main.check.java5 index 12cf928e58..64410de98f 100644 --- a/test/files/cli/test1/Main.check.java5 +++ b/test/files/cli/test1/Main.check.java5 @@ -1,5 +1,6 @@ Unrecognized option: -cpp Could not create the Java virtual machine. -1: test 1 passed -1: test 2 passed -1: test 3 passed +1: test 1 passed (1) +1: test 2 passed (1) +1: test 3 passed (1) +1: test 4 passed (2) diff --git a/test/files/cli/test1/Main.check.scala b/test/files/cli/test1/Main.check.scala index 12cf928e58..64410de98f 100644 --- a/test/files/cli/test1/Main.check.scala +++ b/test/files/cli/test1/Main.check.scala @@ -1,5 +1,6 @@ Unrecognized option: -cpp Could not create the Java virtual machine. -1: test 1 passed -1: test 2 passed -1: test 3 passed +1: test 1 passed (1) +1: test 2 passed (1) +1: test 3 passed (1) +1: test 4 passed (2) diff --git a/test/files/cli/test1/Main.check.scalac b/test/files/cli/test1/Main.check.scalac index 3f3244da74..099f5ad579 100644 --- a/test/files/cli/test1/Main.check.scalac +++ b/test/files/cli/test1/Main.check.scalac @@ -15,7 +15,7 @@ where possible options include: -encoding Specify character encoding used by source files -windowtitle Specify window title of generated HTML documentation -documenttitle Specify document title of generated HTML documentation - -target: Specify which backend to use (jvm,msil) + -target: Specify which backend to use (jvm-1.5,jvm-1.4,msil,cldc) -migrate Assist in migrating from Scala version 1.0 -debug Output debugging messages -statistics Print compiler statistics @@ -38,6 +38,7 @@ where possible options include: -version Print product version and exit -help Print a synopsis of standard options -Xinline Perform inlining when possible + -Xcloselim Perform closure elimination -Xshowcls Show class info -Xshowobj Show object info -Xshowicode Print the generated ICode diff --git a/test/files/cli/test1/Main.check.scalaint b/test/files/cli/test1/Main.check.scalaint index f19606ede5..7340d0988f 100644 --- a/test/files/cli/test1/Main.check.scalaint +++ b/test/files/cli/test1/Main.check.scalaint @@ -14,7 +14,7 @@ where possible options include: -encoding Specify character encoding used by source files -windowtitle Specify window title of generated HTML documentation -documenttitle Specify document title of generated HTML documentation - -target: Specify which backend to use (jvm,msil) + -target: Specify which backend to use (jvm-1.5,jvm-1.4,msil,cldc) -migrate Assist in migrating from Scala version 1.0 -debug Output debugging messages -statistics Print compiler statistics @@ -37,6 +37,7 @@ where possible options include: -version Print product version and exit -help Print a synopsis of standard options -Xinline Perform inlining when possible + -Xcloselim Perform closure elimination -Xshowcls Show class info -Xshowobj Show object info -Xshowicode Print the generated ICode @@ -65,7 +66,7 @@ Type :load followed by a filename to load a sequence of interpreter commands. Type :replay to reset execution and replay all previous commands. Type :help to repeat this message later. -scala> 1: test 2 passed +scala> 1: test 2 passed (1) line0: scala.Unit = () scala> @@ -77,7 +78,7 @@ Type :load followed by a filename to load a sequence of interpreter commands. Type :replay to reset execution and replay all previous commands. Type :help to repeat this message later. -scala> 1: test 3 passed +scala> 1: test 3 passed (1) line0: scala.Unit = () scala> diff --git a/test/files/cli/test1/Main.java b/test/files/cli/test1/Main.java index 14e94cb4c5..8850b87517 100644 --- a/test/files/cli/test1/Main.java +++ b/test/files/cli/test1/Main.java @@ -3,6 +3,6 @@ package test1; public class Main { public static void main(String args[]) { String arg = (args.length > 0) ? args[0] : "?"; - System.out.println("1: test " + arg + " passed"); + System.out.println("1: test " + arg + " passed (" + args.length + ")"); } } diff --git a/test/files/cli/test1/Main.scala b/test/files/cli/test1/Main.scala index 8a4da2d0ab..f7dd8a0a36 100644 --- a/test/files/cli/test1/Main.scala +++ b/test/files/cli/test1/Main.scala @@ -3,6 +3,6 @@ package test1 object Main { def main(args: Array[String]) = { val arg = if (args != null && args.length > 0) args(0) else "?" - Console.println("1: test " + arg + " passed") + Console.println("1: test " + arg + " passed (" + args.length + ")") } } diff --git a/test/files/cli/test2/Main.check.java5 b/test/files/cli/test2/Main.check.java5 index 8929b20b08..aca383de3e 100644 --- a/test/files/cli/test2/Main.check.java5 +++ b/test/files/cli/test2/Main.check.java5 @@ -1,5 +1,6 @@ Unrecognized option: -cpp Could not create the Java virtual machine. -2: 1: test 1 passed -2: 1: test 2 passed -2: 1: test 3 passed +2: 1: test 1 passed (1) +2: 1: test 2 passed (1) +2: 1: test 3 passed (1) +2: 1: test 4 passed (2) diff --git a/test/files/cli/test2/Main.check.scala b/test/files/cli/test2/Main.check.scala index 8929b20b08..aca383de3e 100644 --- a/test/files/cli/test2/Main.check.scala +++ b/test/files/cli/test2/Main.check.scala @@ -1,5 +1,6 @@ Unrecognized option: -cpp Could not create the Java virtual machine. -2: 1: test 1 passed -2: 1: test 2 passed -2: 1: test 3 passed +2: 1: test 1 passed (1) +2: 1: test 2 passed (1) +2: 1: test 3 passed (1) +2: 1: test 4 passed (2) diff --git a/test/files/cli/test2/Main.check.scalac b/test/files/cli/test2/Main.check.scalac index 3f3244da74..099f5ad579 100644 --- a/test/files/cli/test2/Main.check.scalac +++ b/test/files/cli/test2/Main.check.scalac @@ -15,7 +15,7 @@ where possible options include: -encoding Specify character encoding used by source files -windowtitle Specify window title of generated HTML documentation -documenttitle Specify document title of generated HTML documentation - -target: Specify which backend to use (jvm,msil) + -target: Specify which backend to use (jvm-1.5,jvm-1.4,msil,cldc) -migrate Assist in migrating from Scala version 1.0 -debug Output debugging messages -statistics Print compiler statistics @@ -38,6 +38,7 @@ where possible options include: -version Print product version and exit -help Print a synopsis of standard options -Xinline Perform inlining when possible + -Xcloselim Perform closure elimination -Xshowcls Show class info -Xshowobj Show object info -Xshowicode Print the generated ICode diff --git a/test/files/cli/test2/Main.check.scalaint b/test/files/cli/test2/Main.check.scalaint index 69bc170c4c..ff5d6cda12 100644 --- a/test/files/cli/test2/Main.check.scalaint +++ b/test/files/cli/test2/Main.check.scalaint @@ -14,7 +14,7 @@ where possible options include: -encoding Specify character encoding used by source files -windowtitle Specify window title of generated HTML documentation -documenttitle Specify document title of generated HTML documentation - -target: Specify which backend to use (jvm,msil) + -target: Specify which backend to use (jvm-1.5,jvm-1.4,msil,cldc) -migrate Assist in migrating from Scala version 1.0 -debug Output debugging messages -statistics Print compiler statistics @@ -37,6 +37,7 @@ where possible options include: -version Print product version and exit -help Print a synopsis of standard options -Xinline Perform inlining when possible + -Xcloselim Perform closure elimination -Xshowcls Show class info -Xshowobj Show object info -Xshowicode Print the generated ICode @@ -53,7 +54,7 @@ Type :load followed by a filename to load a sequence of interpreter commands. Type :replay to reset execution and replay all previous commands. Type :help to repeat this message later. -scala> 2: 1: test 1 passed +scala> 2: 1: test 1 passed (1) line0: scala.Unit = () scala> @@ -65,7 +66,7 @@ Type :load followed by a filename to load a sequence of interpreter commands. Type :replay to reset execution and replay all previous commands. Type :help to repeat this message later. -scala> 2: 1: test 2 passed +scala> 2: 1: test 2 passed (1) line0: scala.Unit = () scala> @@ -77,7 +78,7 @@ Type :load followed by a filename to load a sequence of interpreter commands. Type :replay to reset execution and replay all previous commands. Type :help to repeat this message later. -scala> 2: 1: test 3 passed +scala> 2: 1: test 3 passed (1) line0: scala.Unit = () scala> diff --git a/test/files/cli/test3/Main.check.java5 b/test/files/cli/test3/Main.check.java5 index d920b45a05..de3eb7b136 100644 --- a/test/files/cli/test3/Main.check.java5 +++ b/test/files/cli/test3/Main.check.java5 @@ -1,8 +1,10 @@ Unrecognized option: -cpp Could not create the Java virtual machine. -3: 1: test 1 passed -3: 2: 1: test 1 passed -3: 1: test 2 passed -3: 2: 1: test 2 passed -3: 1: test 3 passed -3: 2: 1: test 3 passed +3: 1: test 1 passed (1) +3: 2: 1: test 1 passed (1) +3: 1: test 2 passed (1) +3: 2: 1: test 2 passed (1) +3: 1: test 3 passed (1) +3: 2: 1: test 3 passed (1) +3: 1: test 4 passed (2) +3: 2: 1: test 4 passed (2) diff --git a/test/files/cli/test3/Main.check.scala b/test/files/cli/test3/Main.check.scala index d920b45a05..de3eb7b136 100644 --- a/test/files/cli/test3/Main.check.scala +++ b/test/files/cli/test3/Main.check.scala @@ -1,8 +1,10 @@ Unrecognized option: -cpp Could not create the Java virtual machine. -3: 1: test 1 passed -3: 2: 1: test 1 passed -3: 1: test 2 passed -3: 2: 1: test 2 passed -3: 1: test 3 passed -3: 2: 1: test 3 passed +3: 1: test 1 passed (1) +3: 2: 1: test 1 passed (1) +3: 1: test 2 passed (1) +3: 2: 1: test 2 passed (1) +3: 1: test 3 passed (1) +3: 2: 1: test 3 passed (1) +3: 1: test 4 passed (2) +3: 2: 1: test 4 passed (2) diff --git a/test/files/cli/test3/Main.check.scalac b/test/files/cli/test3/Main.check.scalac index 3f3244da74..099f5ad579 100644 --- a/test/files/cli/test3/Main.check.scalac +++ b/test/files/cli/test3/Main.check.scalac @@ -15,7 +15,7 @@ where possible options include: -encoding Specify character encoding used by source files -windowtitle Specify window title of generated HTML documentation -documenttitle Specify document title of generated HTML documentation - -target: Specify which backend to use (jvm,msil) + -target: Specify which backend to use (jvm-1.5,jvm-1.4,msil,cldc) -migrate Assist in migrating from Scala version 1.0 -debug Output debugging messages -statistics Print compiler statistics @@ -38,6 +38,7 @@ where possible options include: -version Print product version and exit -help Print a synopsis of standard options -Xinline Perform inlining when possible + -Xcloselim Perform closure elimination -Xshowcls Show class info -Xshowobj Show object info -Xshowicode Print the generated ICode diff --git a/test/files/cli/test3/Main.check.scalaint b/test/files/cli/test3/Main.check.scalaint index 2fdf9c927a..2de27b074f 100644 --- a/test/files/cli/test3/Main.check.scalaint +++ b/test/files/cli/test3/Main.check.scalaint @@ -14,7 +14,7 @@ where possible options include: -encoding Specify character encoding used by source files -windowtitle Specify window title of generated HTML documentation -documenttitle Specify document title of generated HTML documentation - -target: Specify which backend to use (jvm,msil) + -target: Specify which backend to use (jvm-1.5,jvm-1.4,msil,cldc) -migrate Assist in migrating from Scala version 1.0 -debug Output debugging messages -statistics Print compiler statistics @@ -37,6 +37,7 @@ where possible options include: -version Print product version and exit -help Print a synopsis of standard options -Xinline Perform inlining when possible + -Xcloselim Perform closure elimination -Xshowcls Show class info -Xshowobj Show object info -Xshowicode Print the generated ICode @@ -53,8 +54,8 @@ Type :load followed by a filename to load a sequence of interpreter commands. Type :replay to reset execution and replay all previous commands. Type :help to repeat this message later. -scala> 3: 1: test 1 passed -3: 2: 1: test 1 passed +scala> 3: 1: test 1 passed (1) +3: 2: 1: test 1 passed (1) line0: scala.Unit = () scala> @@ -66,8 +67,8 @@ Type :load followed by a filename to load a sequence of interpreter commands. Type :replay to reset execution and replay all previous commands. Type :help to repeat this message later. -scala> 3: 1: test 2 passed -3: 2: 1: test 2 passed +scala> 3: 1: test 2 passed (1) +3: 2: 1: test 2 passed (1) line0: scala.Unit = () scala> @@ -79,8 +80,8 @@ Type :load followed by a filename to load a sequence of interpreter commands. Type :replay to reset execution and replay all previous commands. Type :help to repeat this message later. -scala> 3: 1: test 3 passed -3: 2: 1: test 3 passed +scala> 3: 1: test 3 passed (1) +3: 2: 1: test 3 passed (1) line0: scala.Unit = () scala> -- cgit v1.2.3