summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authormichelou <michelou@epfl.ch>2006-04-24 15:15:56 +0000
committermichelou <michelou@epfl.ch>2006-04-24 15:15:56 +0000
commit1819fb81bfb65e97acce6d45eda237735c65b01c (patch)
treed8c42a502d618939364a9a5197e69d7b3edbc24c /test
parent78d3bf33640987c825fa97f11f19919b1bca6dde (diff)
downloadscala-1819fb81bfb65e97acce6d45eda237735c65b01c.tar.gz
scala-1819fb81bfb65e97acce6d45eda237735c65b01c.tar.bz2
scala-1819fb81bfb65e97acce6d45eda237735c65b01c.zip
corrected errors in script test/clitest
added cli tests to package 'scala-test'
Diffstat (limited to 'test')
-rwxr-xr-xtest/clitest25
-rw-r--r--test/files/cli/test1/Main.check.java55
-rw-r--r--test/files/cli/test1/Main.check.javac629
-rw-r--r--test/files/cli/test2/Main.check.java55
-rw-r--r--test/files/cli/test2/Main.check.javac54
-rw-r--r--test/files/cli/test2/Main.check.javac633
-rw-r--r--test/files/cli/test3/Main.check.java58
-rw-r--r--test/files/cli/test3/Main.check.javac57
-rw-r--r--test/files/cli/test3/Main.check.javac636
9 files changed, 135 insertions, 17 deletions
diff --git a/test/clitest b/test/clitest
index c2055af9fa..634fa5700c 100755
--- a/test/clitest
+++ b/test/clitest
@@ -132,6 +132,8 @@ test_compile() {
[ -d "$OUTPUT_DIR" ] || mkdir -p $OUTPUT_DIR;
[ -f "$LOG_FILE" ] && rm $LOG_FILE;
suffix=".$COMPILER"
+ [ "$LANG" = "java5" ] && suffix="${suffix}5";
+ [ "$LANG" = "java6" ] && suffix="${suffix}6";
file=`echo $source | sed -e "s#$PREFIX/##g"`;
if [ "$LEVEL" = "info" ] || [ "$LEVEL" = "verbose" ] ; then
@@ -171,20 +173,24 @@ test_execute() {
main="$1"; shift 1;
check="$1"; shift 1;
suffix=".$LANG"
+ [ "$LANG" = "java6" ] && suffix=".java5";
[ -f "$LOG_FILE" ] && rm $LOG_FILE;
printf "\\n";
printf "Execute $main with unknown option '-cpp'\\n"
- test_run "env CLASSPATH= $SCALA -cpp $OUTPUT_DIR $main 2 \
+ test_run "env CLASSPATH= \
+ $RUNTIME_COMMAND -cpp $OUTPUT_DIR $main 2 \
2>> $LOG_FILE 1>> $LOG_FILE";
printf "Execute $main with variable CLASSPATH\\n"
- test_run "env CLASSPATH=$OUTPUT_DIR $SCALA $main 1 \
+ test_run "env CLASSPATH=$OUTPUT_DIR \
+ $RUNTIME_COMMAND $main 1 \
2>> $LOG_FILE 1>> $LOG_FILE";
printf "Execute $main with option -classpath\\n"
- test_run "env CLASSPATH= $SCALA -cp $OUTPUT_DIR $main 2 \
+ test_run "env CLASSPATH= \
+ $RUNTIME_COMMAND -cp $OUTPUT_DIR $main 2 \
2>> $LOG_FILE 1>> $LOG_FILE";
printf "Execute $main with current directory as default classpath\\n"
@@ -268,7 +274,13 @@ else
TMP_DIR=${TMPDIR-/tmp}/tmp.123
fi
-TEST_DIR=$PREFIX/test
+if [ -d "$PREFIX/test" ]; then
+ TEST_DIR="$PREFIX/test";
+elif [ -d "$PREFIX/misc/scala-test" ]; then
+ TEST_DIR="$PREFIX/misc/scala-test";
+else
+ abort "Test directory not found";
+fi;
SOURCE_DIR=$TEST_DIR/files/cli
OUTPUT_DIR=$TMP_DIR/classes
@@ -329,7 +341,7 @@ if [ "$LANG" = "java" ]; then
[ `echo "$jvm_version" | grep -c "J9"` = "1" ] && LANG="j9vm";
if [ "$COMPILER" = "jikes" ]; then
if [ "$LANG" = "java" ]; then
- jre_home=`dirname $SCALA`/..;
+ jre_home=`dirname $RUNTIME_COMMAND`/..;
elif [ -n "$JRE_DIR" ]; then
jre_home=$JRE_DIR;
else
@@ -338,7 +350,8 @@ if [ "$LANG" = "java" ]; then
cpath=`find $jre_home -name "rt.jar"`;
COMPILER_COMMAND="${COMPILER_COMMAND} -bootclasspath $cpath";
fi;
- [ `echo "$jvm_version" | grep -c "1.5"` = "1" ] && LANG="${LANG}5";
+ [ `echo "$jvm_version" | grep -c "1\.5"` = "1" ] && LANG="${LANG}5";
+ [ `echo "$jvm_version" | grep -c "1\.6"` = "1" ] && LANG="${LANG}6";
fi
##############################################################################
diff --git a/test/files/cli/test1/Main.check.java5 b/test/files/cli/test1/Main.check.java5
new file mode 100644
index 0000000000..12cf928e58
--- /dev/null
+++ b/test/files/cli/test1/Main.check.java5
@@ -0,0 +1,5 @@
+Unrecognized option: -cpp
+Could not create the Java virtual machine.
+1: test 1 passed
+1: test 2 passed
+1: test 3 passed
diff --git a/test/files/cli/test1/Main.check.javac6 b/test/files/cli/test1/Main.check.javac6
new file mode 100644
index 0000000000..8f37a05bcb
--- /dev/null
+++ b/test/files/cli/test1/Main.check.javac6
@@ -0,0 +1,29 @@
+javac: invalid flag: -dd
+Usage: javac <options> <source files>
+where possible options include:
+ -g Generate all debugging info
+ -g:none Generate no debugging info
+ -g:{lines,vars,source} Generate only some debugging info
+ -nowarn Generate no warnings
+ -verbose Output messages about what the compiler is doing
+ -deprecation Output source locations where deprecated APIs are used
+ -classpath <path> Specify where to find user class files and annotation processors
+ -cp <path> Specify where to find user class files and annotation processors
+ -sourcepath <path> Specify where to find input source files
+ -bootclasspath <path> Override location of bootstrap class files
+ -extdirs <dirs> Override location of installed extensions
+ -endorseddirs <dirs> Override location of endorsed standards path
+ -proc:{none, only} Control whether annotation processing and/or compilation is done.
+ -processor <class> Name of the annotation processor to run; bypasses default discovery process
+ -processorpath <path> Specify where to find annotation processors
+ -d <directory> Specify where to place generated class files
+ -s <directory> Specify where to place generated source files
+ -encoding <encoding> Specify character encoding used by source files
+ -source <release> Provide source compatibility with specified release
+ -target <release> Generate class files for specific VM version
+ -version Version information
+ -help Print a synopsis of standard options
+ -A[key[=value]] Options to pass to annotation processors
+ -X Print a synopsis of nonstandard options
+ -J<flag> Pass <flag> directly to the runtime system
+
diff --git a/test/files/cli/test2/Main.check.java5 b/test/files/cli/test2/Main.check.java5
new file mode 100644
index 0000000000..8929b20b08
--- /dev/null
+++ b/test/files/cli/test2/Main.check.java5
@@ -0,0 +1,5 @@
+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
diff --git a/test/files/cli/test2/Main.check.javac5 b/test/files/cli/test2/Main.check.javac5
index d20df8ffe7..52bb3a06e3 100644
--- a/test/files/cli/test2/Main.check.javac5
+++ b/test/files/cli/test2/Main.check.javac5
@@ -26,7 +26,3 @@ files/cli/test2/Main.java:5: package test1 does not exist
test1.Main.main(args);
^
1 error
-files/cli/test2/Main.java:5: package test1 does not exist
- test1.Main.main(args);
- ^
-1 error
diff --git a/test/files/cli/test2/Main.check.javac6 b/test/files/cli/test2/Main.check.javac6
new file mode 100644
index 0000000000..350d3253bc
--- /dev/null
+++ b/test/files/cli/test2/Main.check.javac6
@@ -0,0 +1,33 @@
+javac: invalid flag: -dd
+Usage: javac <options> <source files>
+where possible options include:
+ -g Generate all debugging info
+ -g:none Generate no debugging info
+ -g:{lines,vars,source} Generate only some debugging info
+ -nowarn Generate no warnings
+ -verbose Output messages about what the compiler is doing
+ -deprecation Output source locations where deprecated APIs are used
+ -classpath <path> Specify where to find user class files and annotation processors
+ -cp <path> Specify where to find user class files and annotation processors
+ -sourcepath <path> Specify where to find input source files
+ -bootclasspath <path> Override location of bootstrap class files
+ -extdirs <dirs> Override location of installed extensions
+ -endorseddirs <dirs> Override location of endorsed standards path
+ -proc:{none, only} Control whether annotation processing and/or compilation is done.
+ -processor <class> Name of the annotation processor to run; bypasses default discovery process
+ -processorpath <path> Specify where to find annotation processors
+ -d <directory> Specify where to place generated class files
+ -s <directory> Specify where to place generated source files
+ -encoding <encoding> Specify character encoding used by source files
+ -source <release> Provide source compatibility with specified release
+ -target <release> Generate class files for specific VM version
+ -version Version information
+ -help Print a synopsis of standard options
+ -A[key[=value]] Options to pass to annotation processors
+ -X Print a synopsis of nonstandard options
+ -J<flag> Pass <flag> directly to the runtime system
+
+files/cli/test2/Main.java:5: package test1 does not exist
+ test1.Main.main(args);
+ ^
+1 error
diff --git a/test/files/cli/test3/Main.check.java5 b/test/files/cli/test3/Main.check.java5
new file mode 100644
index 0000000000..d920b45a05
--- /dev/null
+++ b/test/files/cli/test3/Main.check.java5
@@ -0,0 +1,8 @@
+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
diff --git a/test/files/cli/test3/Main.check.javac5 b/test/files/cli/test3/Main.check.javac5
index f97ed7066b..2a5d233989 100644
--- a/test/files/cli/test3/Main.check.javac5
+++ b/test/files/cli/test3/Main.check.javac5
@@ -29,10 +29,3 @@ files/cli/test3/Main.java:7: package test2 does not exist
test2.Main.main(args);
^
2 errors
-files/cli/test3/Main.java:5: package test1 does not exist
- test1.Main.main(args);
- ^
-files/cli/test3/Main.java:7: package test2 does not exist
- test2.Main.main(args);
- ^
-2 errors
diff --git a/test/files/cli/test3/Main.check.javac6 b/test/files/cli/test3/Main.check.javac6
new file mode 100644
index 0000000000..677b950aed
--- /dev/null
+++ b/test/files/cli/test3/Main.check.javac6
@@ -0,0 +1,36 @@
+javac: invalid flag: -dd
+Usage: javac <options> <source files>
+where possible options include:
+ -g Generate all debugging info
+ -g:none Generate no debugging info
+ -g:{lines,vars,source} Generate only some debugging info
+ -nowarn Generate no warnings
+ -verbose Output messages about what the compiler is doing
+ -deprecation Output source locations where deprecated APIs are used
+ -classpath <path> Specify where to find user class files and annotation processors
+ -cp <path> Specify where to find user class files and annotation processors
+ -sourcepath <path> Specify where to find input source files
+ -bootclasspath <path> Override location of bootstrap class files
+ -extdirs <dirs> Override location of installed extensions
+ -endorseddirs <dirs> Override location of endorsed standards path
+ -proc:{none, only} Control whether annotation processing and/or compilation is done.
+ -processor <class> Name of the annotation processor to run; bypasses default discovery process
+ -processorpath <path> Specify where to find annotation processors
+ -d <directory> Specify where to place generated class files
+ -s <directory> Specify where to place generated source files
+ -encoding <encoding> Specify character encoding used by source files
+ -source <release> Provide source compatibility with specified release
+ -target <release> Generate class files for specific VM version
+ -version Version information
+ -help Print a synopsis of standard options
+ -A[key[=value]] Options to pass to annotation processors
+ -X Print a synopsis of nonstandard options
+ -J<flag> Pass <flag> directly to the runtime system
+
+files/cli/test3/Main.java:5: package test1 does not exist
+ test1.Main.main(args);
+ ^
+files/cli/test3/Main.java:7: package test2 does not exist
+ test2.Main.main(args);
+ ^
+2 errors