summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authormichelou <michelou@epfl.ch>2011-11-27 11:41:16 +0000
committermichelou <michelou@epfl.ch>2011-11-27 11:41:16 +0000
commit172563dfbbc674789fad1f8d8cd6567e06e52c99 (patch)
treece66093b871f42b84aee64456f3def25878a2a5e /test
parent37201dd3cd6da6ca47f651a5b346a7706ae1e561 (diff)
downloadscala-172563dfbbc674789fad1f8d8cd6567e06e52c99.tar.gz
scala-172563dfbbc674789fad1f8d8cd6567e06e52c99.tar.bz2
scala-172563dfbbc674789fad1f8d8cd6567e06e52c99.zip
updated test cases for Scala Ant tasks
Diffstat (limited to 'test')
-rw-r--r--test/files/ant/README42
-rw-r--r--test/files/ant/fsc.check13
-rw-r--r--test/files/ant/fsc001-build.check14
-rw-r--r--test/files/ant/fsc001-build.xml26
-rw-r--r--test/files/ant/fsc001.scala7
-rw-r--r--test/files/ant/fsc002-build.check14
-rw-r--r--test/files/ant/fsc002-build.xml28
-rw-r--r--test/files/ant/fsc002.scala (renamed from test/files/ant/fsc.scala)0
-rw-r--r--test/files/ant/fsc003-build.check14
-rw-r--r--test/files/ant/fsc003-build.xml25
-rw-r--r--test/files/ant/fsc003.scala7
-rw-r--r--test/files/ant/imported.xml111
-rw-r--r--test/files/ant/scalac.check13
-rw-r--r--test/files/ant/scalac001-build.check14
-rw-r--r--test/files/ant/scalac001-build.xml26
-rw-r--r--test/files/ant/scalac001.scala (renamed from test/files/ant/scalac.scala)0
-rw-r--r--test/files/ant/scalac002-build.check14
-rw-r--r--test/files/ant/scalac002-build.xml (renamed from test/files/ant/fsc-build.xml)19
-rw-r--r--test/files/ant/scalac002.scala7
-rw-r--r--test/files/ant/scalac003-build.check14
-rw-r--r--test/files/ant/scalac003-build.xml25
-rw-r--r--test/files/ant/scalac003.scala7
-rw-r--r--test/files/ant/scalac004-build.check24
-rw-r--r--test/files/ant/scalac004-build.xml (renamed from test/files/ant/scalac-build.xml)13
-rw-r--r--test/files/ant/scalac004.scala11
-rw-r--r--test/files/ant/scaladoc-build.check (renamed from test/files/ant/scaladoc.check)4
-rw-r--r--test/files/ant/scaladoc-build.xml11
-rw-r--r--test/files/ant/scaladoc.scala5
-rw-r--r--test/files/run/parmap-ops.scala4
-rw-r--r--test/files/run/t4608.scala3
-rw-r--r--test/files/run/t4761.scala4
-rw-r--r--test/files/run/t4895.scala4
32 files changed, 402 insertions, 121 deletions
diff --git a/test/files/ant/README b/test/files/ant/README
new file mode 100644
index 0000000000..8cd8745970
--- /dev/null
+++ b/test/files/ant/README
@@ -0,0 +1,42 @@
+README
+======
+
+Test cases in directory test/files/ant/ are executed by invoking an
+Ant script whose name ends with "build.xml" (eg. "fsc001-build.xml").
+
+The Scala Ant tasks fsc/scalac/scaladoc are instantiated from various
+binaries (quick/pack/latest/installed) and are executed with different
+combinations of Ant attributes/elements:
+
+ +---------------------------+--------------------------+
+ | Attributes | Nested elements |
+------------+---------------------------+--------------------------+
+fsc001 | srcdir,classpath (1) | compilerarg |
+fsc002 | srcref,classpathref (1) | compilerarg |
+fsc003 | (2) | compilerarg,src,include |
+------------+---------------------------+--------------------------+
+scalac001 | srcdir,classpath (1) | |
+scalac002 | srcref,classpathref (1) | |
+scalac003 | (2) | src,include |
+scalac004 | deprecation,unchecked (3) | |
+------------+---------------------------+--------------------------+
+scaladoc | srcdir,classpathref | |
+------------+---------------------------+--------------------------+
+
+Other attributes:
+(1) includes,destdir
+(2) destdir,classpathref
+(3) srcdir,includes,destdir,classpath
+
+
+The above test cases can also be run from the command prompt using one of
+the following shell commands:
+
+1) For quick/pack/latest binaries (-Dbinary=quick|pack|latest)
+
+$ ant -Dbinary=quick -Dproject.dir=$HOME/workspace/scala -f scalac001-build.xml
+
+2) For installed binaries (-Dbinary=installed)
+
+$ ant -Dbinary=installed -Dinstalled.dir=/opt/scala -f scalac001-build.xml
+
diff --git a/test/files/ant/fsc.check b/test/files/ant/fsc.check
deleted file mode 100644
index d6c4f9078f..0000000000
--- a/test/files/ant/fsc.check
+++ /dev/null
@@ -1,13 +0,0 @@
-Buildfile: [...]/files/ant/fsc-build.xml
-
-quick.init:
-
-latest.init:
-
-installed.init:
-
-init:
-
-build:
- [mkdir] Created dir: [...]/files/ant/fsc-ant.obj
- [fsc] Compiling 1 source file to [...]/files/ant/fsc-ant.obj
diff --git a/test/files/ant/fsc001-build.check b/test/files/ant/fsc001-build.check
new file mode 100644
index 0000000000..b5141f587b
--- /dev/null
+++ b/test/files/ant/fsc001-build.check
@@ -0,0 +1,14 @@
+
+quick.init:
+
+pack.init:
+
+latest.init:
+
+installed.init:
+
+init:
+
+build:
+ [mkdir] Created dir: [...]/files/ant/fsc001-ant.obj
+ [fsc] Compiling 1 source file to [...]/files/ant/fsc001-ant.obj
diff --git a/test/files/ant/fsc001-build.xml b/test/files/ant/fsc001-build.xml
new file mode 100644
index 0000000000..0130f3615c
--- /dev/null
+++ b/test/files/ant/fsc001-build.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<project name="fsc001" default="run">
+
+ <import file="${basedir}/imported.xml"/>
+
+<!-- ===========================================================================
+BUILD
+============================================================================ -->
+
+ <target name="build" depends="init">
+ <echo level="verbose" message="build.dir=${build.dir}"/>
+ <mkdir dir="${build.dir}"/>
+ <pathconvert property="classpath" refid="build.classpath"/>
+ <fsc
+ srcdir="${source.dir}"
+ includes="**/${ant.project.name}*.scala"
+ destdir="${build.dir}"
+ classpath="${classpath}">
+ </fsc>
+ <echo level="verbose" message="log.file=${log.file}"/>
+ <replace file="${log.file}" token="${log.dir}" value="[...]/files/ant"/>
+ </target>
+
+</project>
+
diff --git a/test/files/ant/fsc001.scala b/test/files/ant/fsc001.scala
new file mode 100644
index 0000000000..6ede5981ce
--- /dev/null
+++ b/test/files/ant/fsc001.scala
@@ -0,0 +1,7 @@
+package test
+
+object Main {
+ def main(args: Array[String]) {
+ println(args mkString " ")
+ }
+}
diff --git a/test/files/ant/fsc002-build.check b/test/files/ant/fsc002-build.check
new file mode 100644
index 0000000000..0c9c30dbfa
--- /dev/null
+++ b/test/files/ant/fsc002-build.check
@@ -0,0 +1,14 @@
+
+quick.init:
+
+pack.init:
+
+latest.init:
+
+installed.init:
+
+init:
+
+build:
+ [mkdir] Created dir: [...]/files/ant/fsc002-ant.obj
+ [fsc] Compiling 1 source file to [...]/files/ant/fsc002-ant.obj
diff --git a/test/files/ant/fsc002-build.xml b/test/files/ant/fsc002-build.xml
new file mode 100644
index 0000000000..db91070fa1
--- /dev/null
+++ b/test/files/ant/fsc002-build.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<project name="fsc002" default="run">
+
+ <import file="${basedir}/imported.xml"/>
+
+<!-- ===========================================================================
+BUILD
+============================================================================ -->
+
+ <target name="build" depends="init">
+ <echo level="verbose" message="build.dir=${build.dir}"/>
+ <mkdir dir="${build.dir}"/>
+ <path id="source.ref">
+ <pathelement location="${source.dir}"/>
+ </path>
+ <fsc
+ srcref="source.ref"
+ includes="**/${ant.project.name}*.scala"
+ destdir="${build.dir}"
+ classpathref="build.classpath">
+ </fsc>
+ <echo level="verbose" message="log.file=${log.file}"/>
+ <replace file="${log.file}" token="${log.dir}" value="[...]/files/ant"/>
+ </target>
+
+</project>
+
diff --git a/test/files/ant/fsc.scala b/test/files/ant/fsc002.scala
index 47131daac6..47131daac6 100644
--- a/test/files/ant/fsc.scala
+++ b/test/files/ant/fsc002.scala
diff --git a/test/files/ant/fsc003-build.check b/test/files/ant/fsc003-build.check
new file mode 100644
index 0000000000..c8c9ed857e
--- /dev/null
+++ b/test/files/ant/fsc003-build.check
@@ -0,0 +1,14 @@
+
+quick.init:
+
+pack.init:
+
+latest.init:
+
+installed.init:
+
+init:
+
+build:
+ [mkdir] Created dir: [...]/files/ant/fsc003-ant.obj
+ [fsc] Compiling 1 source file to [...]/files/ant/fsc003-ant.obj
diff --git a/test/files/ant/fsc003-build.xml b/test/files/ant/fsc003-build.xml
new file mode 100644
index 0000000000..5f71770bf2
--- /dev/null
+++ b/test/files/ant/fsc003-build.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<project name="fsc003" default="run">
+
+ <import file="${basedir}/imported.xml"/>
+
+<!-- ===========================================================================
+BUILD
+============================================================================ -->
+
+ <target name="build" depends="init">
+ <echo level="verbose" message="build.dir=${build.dir}"/>
+ <mkdir dir="${build.dir}"/>
+ <fsc
+ destdir="${build.dir}"
+ classpathref="build.classpath">
+ <src path="${source.dir}"/>
+ <include name="**/${ant.project.name}*.scala"/>
+ </fsc>
+ <echo level="verbose" message="log.file=${log.file}"/>
+ <replace file="${log.file}" token="${log.dir}" value="[...]/files/ant"/>
+ </target>
+
+</project>
+
diff --git a/test/files/ant/fsc003.scala b/test/files/ant/fsc003.scala
new file mode 100644
index 0000000000..6ede5981ce
--- /dev/null
+++ b/test/files/ant/fsc003.scala
@@ -0,0 +1,7 @@
+package test
+
+object Main {
+ def main(args: Array[String]) {
+ println(args mkString " ")
+ }
+}
diff --git a/test/files/ant/imported.xml b/test/files/ant/imported.xml
index 9e2a3ffa1f..5a4dfc319b 100644
--- a/test/files/ant/imported.xml
+++ b/test/files/ant/imported.xml
@@ -1,6 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project name="imported" default="run" basedir=".">
+<project name="imported">
+
+ <!-- This file is imported by the main Ant script. -->
<!-- Prevents system classpath from being used -->
<property name="build.sysclasspath" value="ignore"/>
@@ -11,11 +13,19 @@ PROPERTIES
<property name="source.dir" value="${basedir}"/>
- <property file="./build.properties"/>
+ <property file="${basedir}/build.properties"/>
+
+ <property name="build.dir" location="${source.dir}/${ant.project.name}-ant.obj"/>
+ <property name="log.dir" location="${source.dir}"/>
+ <property name="log.file" value="${log.dir}/${ant.project.name}-build-ant.log"/>
+ <property name="project.dir" value="../../.."/>
<condition property="quick.binary">
<equals arg1="${binary}" arg2="quick"/>
</condition>
+ <condition property="pack.binary">
+ <equals arg1="${binary}" arg2="pack"/>
+ </condition>
<condition property="latest.binary">
<equals arg1="${binary}" arg2="latest"/>
</condition>
@@ -23,16 +33,15 @@ PROPERTIES
<equals arg1="${binary}" arg2="installed"/>
</condition>
- <fail message="Property 'binary' must be set to either 'quick', 'lastest' or 'installed'.">
+ <fail message="Property 'binary' must be set to either 'quick', 'pack', 'latest' or 'installed'.">
<condition><not><or>
<isset property="quick.binary"/>
+ <isset property="pack.binary"/>
<isset property="latest.binary"/>
<isset property="installed.binary"/>
</or></not></condition>
</fail>
<echo level="verbose" message="binary=${binary}"/>
-
- <property name="build.dir" value="${java.io.tmpdir}/classes-${user.name}"/>
<echo level="verbose" message="build.dir=${build.dir}"/>
<!-- ===========================================================================
@@ -40,25 +49,32 @@ INITIALISATION
============================================================================ -->
<target name="quick.init" if="quick.binary">
- <property name="quick.dir" value="../../../build/quick"/>
- <available file="${quick.dir}" property="quick.present"/>
- <fail
- message="Quick build could not be found."
- unless="quick.present"
- />
+ <property name="quick.dir" value="${project.dir}/build/quick"/>
+ <fail message="Quick build could not be found.">
+ <condition><not><available file="${quick.dir}"/></not></condition>
+ </fail>
<property name="scala.dir" value="${quick.dir}"/>
- <property name="scala-library.lib" value="${scala.dir}/lib/library/"/>
- <property name="scala-compiler.lib" value="${scala.dir}/lib/compiler/"/>
- <property name="fjbg.lib" value="${scala.dir}/lib/fjbg.jar"/>
+ <property name="scala-library.lib" value="${scala.dir}/classes/library/"/>
+ <property name="scala-compiler.lib" value="${scala.dir}/classes/compiler/"/>
+ <property name="fjbg.lib" value="${project.dir}/lib/fjbg.jar"/>
+ </target>
+
+ <target name="pack.init" if="pack.binary">
+ <property name="pack.dir" value="${project.dir}/build/pack"/>
+ <fail message="Pack build could not be found.">
+ <condition><not><available file="${pack.dir}"/></not></condition>
+ </fail>
+ <property name="scala.dir" value="${pack.dir}"/>
+ <property name="scala-library.lib" value="${scala.dir}/lib/scala-library.jar"/>
+ <property name="scala-compiler.lib" value="${scala.dir}/lib/scala-compiler.jar"/>
+ <property name="fjbg.lib" value=""/>
</target>
<target name="latest.init" if="latest.binary">
- <property name="latest.dir" value="../../../dists/latest"/>
- <available file="${latest.dir}" property="latest.present"/>
- <fail
- message="Latest build could not be found."
- unless="latest.present"
- />
+ <property name="latest.dir" value="${project.dir}/dists/latest"/>
+ <fail message="Latest build could not be found.">
+ <condition><not><available file="${latest.dir}"/></not></condition>
+ </fail>
<property name="scala.dir" value="${latest.dir}"/>
<property name="scala-library.lib" value="${scala.dir}/lib/scala-library.jar"/>
<property name="scala-compiler.lib" value="${scala.dir}/lib/scala-compiler.jar"/>
@@ -66,55 +82,52 @@ INITIALISATION
</target>
<target name="installed.init" if="installed.binary">
- <property name="installed.dir" value="/home/linuxsoft/apps/scala/share/scala"/>
- <available file="${installed.dir}" property="installed.present"/>
- <fail
- message="Installed distribution could not be found."
- unless="installed.present"
- />
+ <property name="installed.dir" value="/opt/scala"/>
+ <fail message="Installed distribution could not be found.">
+ <condition><not><available file="${installed.dir}"/></not></condition>
+ </fail>
<property name="scala.dir" value="${installed.dir}"/>
<property name="scala-library.lib" value="${scala.dir}/lib/scala-library.jar"/>
<property name="scala-compiler.lib" value="${scala.dir}/lib/scala-compiler.jar"/>
<property name="fjbg.lib" value=""/>
</target>
- <target name="init" depends="quick.init, latest.init, installed.init">
+ <target name="init" depends="quick.init, pack.init, latest.init, installed.init">
<echo level="verbose" message="scala.dir=${scala.dir}"/>
- <fail message="Scala library '${scala-library.lib}' is not available">
+
+ <path id="scala.classpath">
+ <pathelement location="${scala-library.lib}"/>
+ <pathelement location="${scala-compiler.lib}"/>
+ <pathelement location="${fjbg.lib}"/> <!-- only present for 'quick' -->
+ </path>
+
+ <fail message="Scala library '${scala-library.lib}' or '${scala-compiler.lib}' is missing/broken">
<condition><not><and>
<available classname="scala.Predef"
- classpath="${scala-library.lib}"/>
- <available classname="scala.List"
- classpath="${scala-library.lib}"/>
+ classpathref="scala.classpath"/>
+ <available classname="scala.Option"
+ classpathref="scala.classpath"/>
<available classname="scala.runtime.ObjectRef"
- classpath="${scala-library.lib}"/>
- </and></not></condition>
- </fail>
- <fail message="Scala library '${scala-compiler.lib}' is not available">
- <condition><not><and>
+ classpathref="scala.classpath"/>
<available classname="scala.tools.ant.Scalac"
- classpath="${scala-compiler.lib}"/>
+ classpathref="scala.classpath"/>
<available classname="scala.tools.nsc.Main"
- classpath="${scala-compiler.lib}"/>
+ classpathref="scala.classpath"/>
<available classname="scala.tools.util.StringOps"
- classpath="${scala-compiler.lib}"/>
+ classpathref="scala.classpath"/>
</and></not></condition>
</fail>
- <path id="scala.classpath">
- <pathelement location="${scala-library.lib}"/>
- <pathelement location="${scala-compiler.lib}"/>
- <pathelement location="${fjbg.lib}"/> <!-- only present for 'quick' -->
- </path>
- <taskdef resource="scala/tools/ant/antlib.xml">
- <classpath>
- <path refid="scala.classpath"/>
- </classpath>
- </taskdef>
+ <taskdef resource="scala/tools/ant/antlib.xml" classpathref="scala.classpath"/>
+
<path id="build.classpath">
<!--<pathelement location="${scala-actors.lib}"/>-->
<pathelement location="${scala-library.lib}"/>
<pathelement location="${build.dir}"/>
</path>
+
+ <!-- make sure the log file exists when the Ant build scripts -->
+ <!-- are run manually from the command prompt -->
+ <touch file="${log.file}"/>
</target>
<!-- ===========================================================================
diff --git a/test/files/ant/scalac.check b/test/files/ant/scalac.check
deleted file mode 100644
index c7bd156484..0000000000
--- a/test/files/ant/scalac.check
+++ /dev/null
@@ -1,13 +0,0 @@
-Buildfile: [...]/files/ant/scalac-build.xml
-
-quick.init:
-
-latest.init:
-
-installed.init:
-
-init:
-
-build:
- [mkdir] Created dir: [...]/files/ant/scalac-ant.obj
- [scalac] Compiling 1 source file to [...]/files/ant/scalac-ant.obj
diff --git a/test/files/ant/scalac001-build.check b/test/files/ant/scalac001-build.check
new file mode 100644
index 0000000000..05a43ba572
--- /dev/null
+++ b/test/files/ant/scalac001-build.check
@@ -0,0 +1,14 @@
+
+quick.init:
+
+pack.init:
+
+latest.init:
+
+installed.init:
+
+init:
+
+build:
+ [mkdir] Created dir: [...]/files/ant/scalac001-ant.obj
+ [scalac] Compiling 1 source file to [...]/files/ant/scalac001-ant.obj
diff --git a/test/files/ant/scalac001-build.xml b/test/files/ant/scalac001-build.xml
new file mode 100644
index 0000000000..4ec7fc833c
--- /dev/null
+++ b/test/files/ant/scalac001-build.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<project name="scalac001" default="run">
+
+ <import file="${basedir}/imported.xml"/>
+
+<!-- ===========================================================================
+BUILD
+============================================================================ -->
+
+ <target name="build" depends="init">
+ <echo level="verbose" message="build.dir=${build.dir}"/>
+ <mkdir dir="${build.dir}"/>
+ <pathconvert property="classpath" refid="build.classpath"/>
+ <scalac
+ srcdir="${source.dir}"
+ includes="**/${ant.project.name}*.scala"
+ destdir="${build.dir}"
+ classpath="${classpath}"
+ />
+ <echo level="verbose" message="log.file=${log.file}"/>
+ <replace file="${log.file}" token="${log.dir}" value="[...]/files/ant"/>
+ </target>
+
+</project>
+
diff --git a/test/files/ant/scalac.scala b/test/files/ant/scalac001.scala
index 47131daac6..47131daac6 100644
--- a/test/files/ant/scalac.scala
+++ b/test/files/ant/scalac001.scala
diff --git a/test/files/ant/scalac002-build.check b/test/files/ant/scalac002-build.check
new file mode 100644
index 0000000000..e7b3670a0c
--- /dev/null
+++ b/test/files/ant/scalac002-build.check
@@ -0,0 +1,14 @@
+
+quick.init:
+
+pack.init:
+
+latest.init:
+
+installed.init:
+
+init:
+
+build:
+ [mkdir] Created dir: [...]/files/ant/scalac002-ant.obj
+ [scalac] Compiling 1 source file to [...]/files/ant/scalac002-ant.obj
diff --git a/test/files/ant/fsc-build.xml b/test/files/ant/scalac002-build.xml
index 9323be1c82..07628afa64 100644
--- a/test/files/ant/fsc-build.xml
+++ b/test/files/ant/scalac002-build.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project name="fsc" default="run" basedir=".">
+<project name="scalac002" default="run">
<import file="${basedir}/imported.xml"/>
@@ -11,20 +11,17 @@ BUILD
<target name="build" depends="init">
<echo level="verbose" message="build.dir=${build.dir}"/>
<mkdir dir="${build.dir}"/>
- <fsc
- srcdir="${source.dir}"
+ <path id="source.ref">
+ <pathelement location="${source.dir}"/>
+ </path>
+ <scalac
+ srcref="source.ref"
includes="**/${ant.project.name}*.scala"
- deprecation="yes" unchecked="yes"
destdir="${build.dir}"
classpathref="build.classpath"
/>
- <dirname property="log.dir" file="${build.dir}"/>
- <echo level="verbose" message="log.dir=${log.dir}"/>
- <replace
- file="${log.dir}/${ant.project.name}-ant.log"
- token="${log.dir}"
- value="[...]/files/ant"
- />
+ <echo level="verbose" message="log.file=${log.file}"/>
+ <replace file="${log.file}" token="${log.dir}" value="[...]/files/ant"/>
</target>
</project>
diff --git a/test/files/ant/scalac002.scala b/test/files/ant/scalac002.scala
new file mode 100644
index 0000000000..6ede5981ce
--- /dev/null
+++ b/test/files/ant/scalac002.scala
@@ -0,0 +1,7 @@
+package test
+
+object Main {
+ def main(args: Array[String]) {
+ println(args mkString " ")
+ }
+}
diff --git a/test/files/ant/scalac003-build.check b/test/files/ant/scalac003-build.check
new file mode 100644
index 0000000000..7b0d3367ed
--- /dev/null
+++ b/test/files/ant/scalac003-build.check
@@ -0,0 +1,14 @@
+
+quick.init:
+
+pack.init:
+
+latest.init:
+
+installed.init:
+
+init:
+
+build:
+ [mkdir] Created dir: [...]/files/ant/scalac003-ant.obj
+ [scalac] Compiling 1 source file to [...]/files/ant/scalac003-ant.obj
diff --git a/test/files/ant/scalac003-build.xml b/test/files/ant/scalac003-build.xml
new file mode 100644
index 0000000000..1d70aa115e
--- /dev/null
+++ b/test/files/ant/scalac003-build.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<project name="scalac003" default="run">
+
+ <import file="${basedir}/imported.xml"/>
+
+<!-- ===========================================================================
+BUILD
+============================================================================ -->
+
+ <target name="build" depends="init">
+ <echo level="verbose" message="build.dir=${build.dir}"/>
+ <mkdir dir="${build.dir}"/>
+ <scalac
+ destdir="${build.dir}"
+ classpathref="build.classpath">
+ <src path="${source.dir}"/>
+ <include name="**/${ant.project.name}*.scala"/>
+ </scalac>
+ <echo level="verbose" message="log.file=${log.file}"/>
+ <replace file="${log.file}" token="${log.dir}" value="[...]/files/ant"/>
+ </target>
+
+</project>
+
diff --git a/test/files/ant/scalac003.scala b/test/files/ant/scalac003.scala
new file mode 100644
index 0000000000..6ede5981ce
--- /dev/null
+++ b/test/files/ant/scalac003.scala
@@ -0,0 +1,7 @@
+package test
+
+object Main {
+ def main(args: Array[String]) {
+ println(args mkString " ")
+ }
+}
diff --git a/test/files/ant/scalac004-build.check b/test/files/ant/scalac004-build.check
new file mode 100644
index 0000000000..ffe9e8c79a
--- /dev/null
+++ b/test/files/ant/scalac004-build.check
@@ -0,0 +1,24 @@
+
+quick.init:
+
+pack.init:
+
+latest.init:
+
+installed.init:
+
+init:
+
+build:
+ [mkdir] Created dir: [...]/files/ant/scalac004-ant.obj
+ [scalac] Compiling 1 source file to [...]/files/ant/scalac004-ant.obj
+ [scalac] [...]/files/ant/scalac004.scala:9: warning: method exit in object Predef is deprecated: Use sys.exit(status) instead
+ [scalac] Predef.exit(0) //deprecated in 2.9.0
+ [scalac] ^
+ [scalac] [...]/files/ant/scalac004.scala:6: warning: match is not exhaustive!
+ [scalac] missing combination Nil
+ [scalac]
+ [scalac] xs match { //(xs: @unchecked) match {
+ [scalac] ^
+ [scalac] two warnings found
+ [scalac] Compile succeeded with 2 warnings; see the compiler output for details.
diff --git a/test/files/ant/scalac-build.xml b/test/files/ant/scalac004-build.xml
index 0276124852..66c19a39fb 100644
--- a/test/files/ant/scalac-build.xml
+++ b/test/files/ant/scalac004-build.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project name="scalac" default="run" basedir=".">
+<project name="scalac004" default="run">
<import file="${basedir}/imported.xml"/>
@@ -12,19 +12,14 @@ BUILD
<echo level="verbose" message="build.dir=${build.dir}"/>
<mkdir dir="${build.dir}"/>
<scalac
+ deprecation="yes" unchecked="yes"
srcdir="${source.dir}"
includes="**/${ant.project.name}*.scala"
- deprecation="yes" unchecked="yes"
destdir="${build.dir}"
classpathref="build.classpath"
/>
- <dirname property="log.dir" file="${build.dir}"/>
- <echo level="verbose" message="log.dir=${log.dir}"/>
- <replace
- file="${log.dir}/${ant.project.name}-ant.log"
- token="${log.dir}"
- value="[...]/files/ant"
- />
+ <echo level="verbose" message="log.file=${log.file}"/>
+ <replace file="${log.file}" token="${log.dir}" value="[...]/files/ant"/>
</target>
</project>
diff --git a/test/files/ant/scalac004.scala b/test/files/ant/scalac004.scala
new file mode 100644
index 0000000000..66b2ba7985
--- /dev/null
+++ b/test/files/ant/scalac004.scala
@@ -0,0 +1,11 @@
+package test
+
+object Main {
+ def main(args: Array[String]) {
+ val xs = List(1, 2, 3, 4)
+ xs match { //(xs: @unchecked) match {
+ case x::xs => println(x)
+ }
+ Predef.exit(0) //deprecated in 2.9.0
+ }
+}
diff --git a/test/files/ant/scaladoc.check b/test/files/ant/scaladoc-build.check
index a404edce45..1c82456ad0 100644
--- a/test/files/ant/scaladoc.check
+++ b/test/files/ant/scaladoc-build.check
@@ -1,7 +1,8 @@
-Buildfile: [...]/files/ant/scaladoc-build.xml
quick.init:
+pack.init:
+
latest.init:
installed.init:
@@ -11,3 +12,4 @@ init:
build:
[mkdir] Created dir: [...]/files/ant/scaladoc-ant.obj
[scaladoc] Documenting 1 source file to [...]/files/ant/scaladoc-ant.obj
+ [scaladoc] model contains 3 documentable templates
diff --git a/test/files/ant/scaladoc-build.xml b/test/files/ant/scaladoc-build.xml
index 839c7bde21..fb4dc6fe69 100644
--- a/test/files/ant/scaladoc-build.xml
+++ b/test/files/ant/scaladoc-build.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project name="scaladoc" default="run" basedir=".">
+<project name="scaladoc" default="run">
<import file="${basedir}/imported.xml"/>
@@ -18,13 +18,8 @@ BUILD
destdir="${build.dir}"
classpathref="build.classpath"
/>
- <dirname property="log.dir" file="${build.dir}"/>
- <echo level="verbose" message="log.dir=${log.dir}"/>
- <replace
- file="${log.dir}/${ant.project.name}-ant.log"
- token="${log.dir}"
- value="[...]/files/ant"
- />
+ <echo level="verbose" message="log.file=${log.file}"/>
+ <replace file="${log.file}" token="${log.dir}" value="[...]/files/ant"/>
</target>
</project>
diff --git a/test/files/ant/scaladoc.scala b/test/files/ant/scaladoc.scala
index 47131daac6..6ede5981ce 100644
--- a/test/files/ant/scaladoc.scala
+++ b/test/files/ant/scaladoc.scala
@@ -1,6 +1,7 @@
package test
object Main {
- def main(args: Array[String]): Unit =
- Console.println(args.toList)
+ def main(args: Array[String]) {
+ println(args mkString " ")
+ }
}
diff --git a/test/files/run/parmap-ops.scala b/test/files/run/parmap-ops.scala
index 31828d9522..f93bd7b77e 100644
--- a/test/files/run/parmap-ops.scala
+++ b/test/files/run/parmap-ops.scala
@@ -1,9 +1,5 @@
-
-
import collection._
-
-
object Test {
def main(args: Array[String]) {
diff --git a/test/files/run/t4608.scala b/test/files/run/t4608.scala
index 3601adc275..2d43bebd10 100644
--- a/test/files/run/t4608.scala
+++ b/test/files/run/t4608.scala
@@ -1,6 +1,3 @@
-
-
-
// #4608
object Test {
diff --git a/test/files/run/t4761.scala b/test/files/run/t4761.scala
index 82818379f5..a9c245d7d5 100644
--- a/test/files/run/t4761.scala
+++ b/test/files/run/t4761.scala
@@ -1,7 +1,3 @@
-
-
-
-
object Test {
def main(args: Array[String]) {
val gs = for (x <- (1 to 5)) yield { if (x % 2 == 0) List(1).seq else List(1).par }
diff --git a/test/files/run/t4895.scala b/test/files/run/t4895.scala
index c6e6cc18b4..a0e8c19f00 100644
--- a/test/files/run/t4895.scala
+++ b/test/files/run/t4895.scala
@@ -1,7 +1,3 @@
-
-
-
-
object Test {
def checkPar(sz: Int) {