diff --git a/test/files/ant/README b/test/files/ant/README new file mode 100644 index 000000000..8cd874597 --- /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 d6c4f9078..000000000 --- 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 000000000..b5141f587 --- /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 000000000..0130f3615 --- /dev/null +++ b/test/files/ant/fsc001-build.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/test/files/ant/fsc001.scala b/test/files/ant/fsc001.scala new file mode 100644 index 000000000..6ede5981c --- /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 000000000..0c9c30dbf --- /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 000000000..db91070fa --- /dev/null +++ b/test/files/ant/fsc002-build.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/files/ant/fsc.scala b/test/files/ant/fsc002.scala similarity index 100% rename from test/files/ant/fsc.scala rename to 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 000000000..c8c9ed857 --- /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 000000000..5f71770bf --- /dev/null +++ b/test/files/ant/fsc003-build.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/test/files/ant/fsc003.scala b/test/files/ant/fsc003.scala new file mode 100644 index 000000000..6ede5981c --- /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 9e2a3ffa1..5a4dfc319 100644 --- a/test/files/ant/imported.xml +++ b/test/files/ant/imported.xml @@ -1,6 +1,8 @@ - + + + @@ -11,11 +13,19 @@ PROPERTIES - + + + + + + + + + @@ -23,16 +33,15 @@ PROPERTIES - + + - - - - - + + + + - - - + + + + + + + + + + + + + + - - - + + + + @@ -66,55 +82,52 @@ INITIALISATION - - - + + + + - + - - - - - - - - - - - - - - + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/files/ant/scalac.scala b/test/files/ant/scalac001.scala similarity index 100% rename from test/files/ant/scalac.scala rename to 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 000000000..e7b3670a0 --- /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 similarity index 59% rename from test/files/ant/fsc-build.xml rename to test/files/ant/scalac002-build.xml index 9323be1c8..07628afa6 100644 --- a/test/files/ant/fsc-build.xml +++ b/test/files/ant/scalac002-build.xml @@ -1,6 +1,6 @@ - + @@ -11,20 +11,17 @@ BUILD - + + + - - - + + diff --git a/test/files/ant/scalac002.scala b/test/files/ant/scalac002.scala new file mode 100644 index 000000000..6ede5981c --- /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 000000000..7b0d3367e --- /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 000000000..1d70aa115 --- /dev/null +++ b/test/files/ant/scalac003-build.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/test/files/ant/scalac003.scala b/test/files/ant/scalac003.scala new file mode 100644 index 000000000..6ede5981c --- /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 000000000..ffe9e8c79 --- /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 similarity index 68% rename from test/files/ant/scalac-build.xml rename to test/files/ant/scalac004-build.xml index 027612485..66c19a39f 100644 --- a/test/files/ant/scalac-build.xml +++ b/test/files/ant/scalac004-build.xml @@ -1,6 +1,6 @@ - + @@ -12,19 +12,14 @@ BUILD - - - + + diff --git a/test/files/ant/scalac004.scala b/test/files/ant/scalac004.scala new file mode 100644 index 000000000..66b2ba798 --- /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 similarity index 74% rename from test/files/ant/scaladoc.check rename to test/files/ant/scaladoc-build.check index a404edce4..1c82456ad 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 839c7bde2..fb4dc6fe6 100644 --- a/test/files/ant/scaladoc-build.xml +++ b/test/files/ant/scaladoc-build.xml @@ -1,6 +1,6 @@ - + @@ -18,13 +18,8 @@ BUILD destdir="${build.dir}" classpathref="build.classpath" /> - - - + + diff --git a/test/files/ant/scaladoc.scala b/test/files/ant/scaladoc.scala index 47131daac..6ede5981c 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 31828d952..f93bd7b77 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 3601adc27..2d43bebd1 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 82818379f..a9c245d7d 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 c6e6cc18b..a0e8c19f0 100644 --- a/test/files/run/t4895.scala +++ b/test/files/run/t4895.scala @@ -1,7 +1,3 @@ - - - - object Test { def checkPar(sz: Int) {