From 5331ce87dd7aa96c327c9ef23e963678c8dc7441 Mon Sep 17 00:00:00 2001 From: michelou Date: Sun, 15 Oct 2006 22:07:54 +0000 Subject: improved Scala test suite on Windows (scalatest... improved Scala test suite on Windows (scalatest.bat) --- test/clitest | 40 ++++++++++++++++++++++++++++++++++ test/diff.README | 16 -------------- test/diff.exe | Bin 150528 -> 0 bytes test/diff/diff.README | 16 ++++++++++++++ test/diff/diff.exe | Bin 0 -> 150528 bytes test/diff/libintl3.dll | Bin 0 -> 92672 bytes test/libintl3.dll | Bin 92672 -> 0 bytes test/scalatest.bat | 58 ++++++++++++++++++++++++++++++++++--------------- 8 files changed, 96 insertions(+), 34 deletions(-) delete mode 100644 test/diff.README delete mode 100644 test/diff.exe create mode 100644 test/diff/diff.README create mode 100755 test/diff/diff.exe create mode 100755 test/diff/libintl3.dll delete mode 100644 test/libintl3.dll (limited to 'test') diff --git a/test/clitest b/test/clitest index 5ae1bf10db..496dc8da70 100755 --- a/test/clitest +++ b/test/clitest @@ -69,6 +69,45 @@ printf_outline() { $printf_font_default; } +############################################################################## +# 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 @@ -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.README deleted file mode 100644 index 7f1fa4108c..0000000000 --- a/test/diff.README +++ /dev/null @@ -1,16 +0,0 @@ -DiffUtils for Windows 2.8.7 ---------------------------- - -DiffUtils shows differences between files. - -Source: http://gnuwin32.sourceforge.net/packages/diffutils.htm - - -The minimal set of files required to run diff is the following: - - bin\diff.exe (150528 bytes) - bin\libiconv2.dll (898048 bytes) - bin\libintl3.dll (92672 bytes) - - -$Id: $ diff --git a/test/diff.exe b/test/diff.exe deleted file mode 100644 index 85f370d867..0000000000 Binary files a/test/diff.exe and /dev/null differ diff --git a/test/diff/diff.README b/test/diff/diff.README new file mode 100644 index 0000000000..839a1c2c9b --- /dev/null +++ b/test/diff/diff.README @@ -0,0 +1,16 @@ +DiffUtils for Windows 2.8.7 +--------------------------- + +DiffUtils shows differences between files. + +Source: http://gnuwin32.sourceforge.net/packages/diffutils.htm + + +The minimal set of files required to run diff is the following: + + bin\diff.exe (150528 bytes) + bin\libiconv2.dll (898048 bytes) + bin\libintl3.dll (92672 bytes) + + +$Id: diff.README 7771 2006-06-12 13:22:39Z dubochet $ diff --git a/test/diff/diff.exe b/test/diff/diff.exe new file mode 100755 index 0000000000..85f370d867 Binary files /dev/null and b/test/diff/diff.exe differ diff --git a/test/diff/libintl3.dll b/test/diff/libintl3.dll new file mode 100755 index 0000000000..2efd2117cd Binary files /dev/null and b/test/diff/libintl3.dll differ diff --git a/test/libintl3.dll b/test/libintl3.dll deleted file mode 100644 index 2efd2117cd..0000000000 Binary files a/test/libintl3.dll and /dev/null 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 ########################################################################## -- cgit v1.2.3