summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtest/clitest40
-rw-r--r--test/diff/diff.README (renamed from test/diff.README)2
-rwxr-xr-x[-rw-r--r--]test/diff/diff.exe (renamed from test/diff.exe)bin150528 -> 150528 bytes
-rwxr-xr-x[-rw-r--r--]test/diff/libintl3.dll (renamed from test/libintl3.dll)bin92672 -> 92672 bytes
-rw-r--r--test/scalatest.bat58
5 files changed, 81 insertions, 19 deletions
diff --git a/test/clitest b/test/clitest
index 5ae1bf10db..496dc8da70 100755
--- a/test/clitest
+++ b/test/clitest
@@ -70,6 +70,45 @@ printf_outline() {
}
##############################################################################
+# File name and path list conversion functions
+
+# Prints the OS-specific form of the specified Unix form file name.
+get_os_filename() {
+ [ $# = 1 ] || abort "internal error";
+ case "$UNAME" in
+ CYGWIN* ) cygpath --windows "$1";;
+ * ) echo "$@";;
+ esac;
+}
+
+# Prints the Unix form of the specified OS-specific form file name.
+get_unix_filename() {
+ [ $# = 1 ] || abort "internal error";
+ case "$UNAME" in
+ CYGWIN* ) cygpath --unix "$1";;
+ * ) echo "$@";;
+ esac;
+}
+
+# Prints the OS-specific form of the specified Unix form path list.
+get_os_pathlist() {
+ [ $# = 1 ] || abort "internal error";
+ case "$UNAME" in
+ CYGWIN* ) cygpath --window --path "$1";;
+ * ) echo "$@";;
+ esac;
+}
+
+# Prints the Unix form of the specified OS-specific form path list.
+get_unix_pathlist() {
+ [ $# = 1 ] || abort "internal error";
+ case "$UNAME" in
+ CYGWIN* ) cygpath --unix --path "$1";;
+ * ) echo "$@";;
+ esac;
+}
+
+##############################################################################
# Implementation of clitest
# Prints the clitest usage.
@@ -166,6 +205,7 @@ test_compile() {
fi
printf "\\n";
+ #=`get_unix_filename "$source"`;
printf "Compile $file ($info) with unknown option '-dd'\\n"
test_run "env CLASSPATH= $COMPILER_COMMAND \
-dd $OUTPUT_DIR $source 2>> $LOG_FILE 1>> $LOG_FILE";
diff --git a/test/diff.README b/test/diff/diff.README
index 7f1fa4108c..839a1c2c9b 100644
--- a/test/diff.README
+++ b/test/diff/diff.README
@@ -13,4 +13,4 @@ The minimal set of files required to run diff is the following:
bin\libintl3.dll (92672 bytes)
-$Id: $
+$Id: diff.README 7771 2006-06-12 13:22:39Z dubochet $
diff --git a/test/diff.exe b/test/diff/diff.exe
index 85f370d867..85f370d867 100644..100755
--- a/test/diff.exe
+++ b/test/diff/diff.exe
Binary files differ
diff --git a/test/libintl3.dll b/test/diff/libintl3.dll
index 2efd2117cd..2efd2117cd 100644..100755
--- a/test/libintl3.dll
+++ b/test/diff/libintl3.dll
Binary files differ
diff --git a/test/scalatest.bat b/test/scalatest.bat
index 5aea0e326b..5a66f61731 100644
--- a/test/scalatest.bat
+++ b/test/scalatest.bat
@@ -1,13 +1,17 @@
@echo off
rem ##########################################################################
-rem # Copyright (c) 2002-06 LAMP/EPFL
+rem # Copyright 2002-2006 LAMP/EPFL
rem #
rem # This is free software; see the distribution for copying conditions.
rem # There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
rem # PARTICULAR PURPOSE.
rem ##########################################################################
+rem We adopt the following conventions:
+rem - System/user environment variables start with a letter
+rem - Local batch variables start with an underscore ('_')
+
if "%OS%"=="Windows_NT" (
@setlocal
call :set_home
@@ -16,9 +20,11 @@ if "%OS%"=="Windows_NT" (
if "%_SCALA_HOME%"=="" goto err_home
)
+rem We use the value of the JAVACMD environment variable if defined
set _JAVACMD=%JAVACMD%
if "%_JAVACMD%"=="" set _JAVACMD=java
+set _BIN=dists\latest\bin
set _NORUN=
set _TYPE=auto
set _SHOWLOG=
@@ -35,6 +41,7 @@ if (%1)==(--jvm) set _TYPE=jvm & goto next
if (%1)==(--pos) set _TYPE=pos & goto next
if (%1)==(--neg) set _TYPE=neg & goto next
if (%1)==(--msil) set _TYPE=msil & goto next
+if (%1)==(--quick) set _BIN=build\quick\bin & goto next
if (%1)==(--no-run) set _NORUN=1 & goto next
if (%1)==(--show-log) set _SHOWLOG=1 & goto next
if (%1)==(--show-diff) set _SHOWDIFF=1 & goto next
@@ -52,12 +59,21 @@ shift
goto loop
:exec
-set _SCALA=%_BINDIR%scala
-set _SCALAC=%_BINDIR%scalac -encoding iso-8859-1
-set _SCALAP=%_BINDIR%scalap
-set _DIFF=%_BINDIR%diff.exe --text --strip-trailing-cr
+if exist "%_SCALA_HOME%\misc\NUL" (
+ set _BINDIR=%_SCALA_HOME%\bin
+ set _SRCDIR=%_SCALA_HOME%\misc\scala-test\files
+ set _DIFFDIR=%_SCALA_HOME%\bin\diff
+) else (
+ set _BINDIR=%_SCALA_HOME%\%_BIN%
+ set _SRCDIR=%_SCALA_HOME%\test\files
+ set _DIFFDIR=%_SCALA_HOME%\test\diff
+)
+
+set _SCALA=%_BINDIR%\scala
+set _SCALAC=%_BINDIR%\scalac -encoding iso-8859-1
+set _SCALAP=%_BINDIR%\scalap
+set _DIFF=%_DIFFDIR%\diff.exe --text --strip-trailing-cr
-set _SRCDIR=%_SCALA_HOME%\misc\scala-test\files
set _OBJDIR=
set _TMPDIR=%TEMP%
@@ -71,6 +87,7 @@ if not "%_TMPDIR%"=="" (
call :prt_dir "Source directory is :" "%_SRCDIR%"
call :prt_dir "Scala binaries are in:" "%_BINDIR%"
call :set_version
+call :prt_dir "Scala version is :" "%_NSC_VERSION%"
call :prt_dir "Java runtime is :" "%_JVM_VERSION%"
set _FILES_POS=
@@ -123,7 +140,8 @@ rem # NB. goto/call commands use only the first 8 characters of a label
echo --jvm next files test the JVM backend
echo --pos next files test a compilation success
echo --neg next files test a compilation failure
- echo --msil next files test the .NET backend
+ echo --msil next files test the .NET
+ echo --quick use the 'quick' build instead of the distribution
echo --no-run run no test, use results of last run
echo --show-log show output of failed tests
echo --show-diff show differences between actual and expected output
@@ -133,7 +151,7 @@ rem # NB. goto/call commands use only the first 8 characters of a label
goto :eof
:prt_version
- echo Scala test suite 0.9.1 -- (c) 2002-2006 LAMP/EPFL
+ echo Scala test suite 0.9.2 -- (c) 2002-2006 LAMP/EPFL
goto :eof
:prt_status
@@ -159,6 +177,9 @@ rem set _SCALA_HOME=%~dps0..
:set_version
set _TMPFILE=%_TMPDIR%\.version
+ call %_SCALAC% -version 2> %_TMPFILE%
+ for /f "tokens=*" %%f in (%_TMPFILE%) do @set _VERSION=%%f
+ set _NSC_VERSION=%_VERSION%
%_JAVACMD% -version 2> %_TMPFILE%
for /f "skip=2 tokens=*" %%f in (%_TMPFILE%) do @set _VERSION=%%f
set _JVM_VERSION=%_VERSION%
@@ -218,19 +239,20 @@ rem Tests the JVM backend.
) else (
set _DSTDIR=%_OBJDIR%
)
- set _TESTNAME=%~n1
- set _DSTBASE=%_DSTDIR%\%_TESTNAME%-%_KIND%
+ set _DSTBASE=%_DSTDIR%\%~n1-%_KIND%
set _LOGFILE=%_DSTBASE%.log
+ set _CHKFILE=%~dpn1.check
if not '%_HEADER%'=='' call :prt_header %_HEADER% & set _HEADER=
- if %_KIND%=="jvm" call :test_jvm %1 & goto status
- if %_KIND%=="pos" call :test_pos %1 & goto status
- if %_KIND%=="neg" call :test_neg %1 & goto status
+ if "%_KIND%"=="jvm" call :test_jvm %1 & goto status
+ if "%_KIND%"=="pos" call :test_pos %1 & goto status
+ if "%_KIND%"=="neg" call :test_neg %1 & goto status
goto :eof
:status
+ if exist %_LOGFILE% %_DIFF% %_LOGFILE% %_CHKFILE%
call :prt_status %_KIND% %~nx1
- del /s/q %_LOGFILE% 1>NUL
+ del /s/q %_LOGFILE% 2>NUL 1>NUL
goto :eof
:chk_file
@@ -260,10 +282,10 @@ rem Tests the JVM backend.
rem Checks everything.
:chk_all
- call :chk_kind "Testing JVM backend" "jvm" %_FILES_RUN% %_FILES_JVM%
- call :chk_kind "Testing compiler (on files whose compilation should succeed)" "pos" %_FILES_POS%
- call :chk_kind "Testing compiler (on files whose compilation should fail)" "neg" %_FILES_NEG%
- call :chk_kind "Testing .NET backend" "msil" %_FILES_MSIL%
+ call :chk_kind "Testing JVM backend" jvm %_FILES_RUN% %_FILES_JVM%
+ call :chk_kind "Testing compiler (on files whose compilation should succeed)" pos %_FILES_POS%
+ call :chk_kind "Testing compiler (on files whose compilation should fail)" neg %_FILES_NEG%
+ call :chk_kind "Testing .NET backend" msil %_FILES_MSIL%
goto :eof
rem ##########################################################################