summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/library/scala/BoxingConversions.scala5
-rw-r--r--src/partest/scala/tools/partest/nest/DirectRunner.scala2
-rw-r--r--src/partest/scala/tools/partest/nest/RunnerManager.scala25
-rw-r--r--test/files/run/Meter.scala5
-rw-r--r--test/files/run/MeterCaseClass.scala5
5 files changed, 33 insertions, 9 deletions
diff --git a/src/library/scala/BoxingConversions.scala b/src/library/scala/BoxingConversions.scala
deleted file mode 100644
index fd1bd6c121..0000000000
--- a/src/library/scala/BoxingConversions.scala
+++ /dev/null
@@ -1,5 +0,0 @@
-package scala
-abstract class BoxingConversions[Boxed, Unboxed] {
- def box(x: Unboxed): Boxed
- def unbox(x: Boxed): Unboxed
-}
diff --git a/src/partest/scala/tools/partest/nest/DirectRunner.scala b/src/partest/scala/tools/partest/nest/DirectRunner.scala
index a07705322d..a890a57f14 100644
--- a/src/partest/scala/tools/partest/nest/DirectRunner.scala
+++ b/src/partest/scala/tools/partest/nest/DirectRunner.scala
@@ -37,6 +37,8 @@ trait DirectRunner {
})
}
def runTestsForFiles(_kindFiles: List[File], kind: String): immutable.Map[String, TestState] = {
+ System.setProperty("line.separator", "\n")
+
// @partest maintainer: we cannot create a fresh file manager here
// since the FM must respect --buildpath and --classpath from the command line
// for example, see how it's done in ReflectiveRunner
diff --git a/src/partest/scala/tools/partest/nest/RunnerManager.scala b/src/partest/scala/tools/partest/nest/RunnerManager.scala
index 4961424e1b..7a42853749 100644
--- a/src/partest/scala/tools/partest/nest/RunnerManager.scala
+++ b/src/partest/scala/tools/partest/nest/RunnerManager.scala
@@ -138,12 +138,29 @@ class RunnerManager(kind: String, val fileManager: FileManager, params: TestRunP
catch exHandler(output, "javac command failed:\n" + args.map(" " + _ + "\n").mkString + "\n", CompilerCrashed)
}
- /** Runs command redirecting standard out and
- * error out to output file.
+ /** Runs command redirecting standard out and error out to output file.
+ * Overloaded to accept a sequence of arguments.
*/
private def runCommand(args: Seq[String], outFile: File): Boolean = {
NestUI.verbose("running command:\n"+args.map(" " + _ + "\n").mkString)
- (Process(args) #> outFile !) == 0
+ runCommandImpl(Process(args), outFile)
+ }
+
+ /** Runs command redirecting standard out and error out to output file.
+ * Overloaded to accept a single string = concatenated command + arguments.
+ */
+ private def runCommand(command: String, outFile: File): Boolean = {
+ NestUI.verbose("running command:"+command)
+ runCommandImpl(Process(command), outFile)
+ }
+
+ private def runCommandImpl(process: => ProcessBuilder, outFile: File): Boolean = {
+ val exitCode = (process #> outFile !)
+ // normalize line endings
+ // System.getProperty("line.separator") should be "\n" here
+ // so reading a file and writing it back should convert all CRLFs to LFs
+ SFile(outFile).printlnAll(SFile(outFile).lines.toList: _*)
+ exitCode == 0
}
@inline private def isJava(f: File) = SFile(f) hasExtension "java"
@@ -767,7 +784,7 @@ class RunnerManager(kind: String, val fileManager: FileManager, params: TestRunP
}
else file.getAbsolutePath
- val ok = ((cmdString+argString) #> logFile !) == 0
+ val ok = runCommand(cmdString+argString, logFile)
( ok && diffCheck(file, compareOutput(file.getParentFile, logFile)) )
}
catch { case e: Exception => NestUI.verbose("caught "+e) ; false }
diff --git a/test/files/run/Meter.scala b/test/files/run/Meter.scala
index a0c04cc2a7..a10ad31b4a 100644
--- a/test/files/run/Meter.scala
+++ b/test/files/run/Meter.scala
@@ -1,4 +1,9 @@
package a {
+ abstract class BoxingConversions[Boxed, Unboxed] {
+ def box(x: Unboxed): Boxed
+ def unbox(x: Boxed): Unboxed
+ }
+
class Meter(val underlying: Double) extends AnyVal with _root_.b.Printable {
def + (other: Meter): Meter =
new Meter(this.underlying + other.underlying)
diff --git a/test/files/run/MeterCaseClass.scala b/test/files/run/MeterCaseClass.scala
index 18f8e23f89..39d95c2af5 100644
--- a/test/files/run/MeterCaseClass.scala
+++ b/test/files/run/MeterCaseClass.scala
@@ -1,4 +1,9 @@
package a {
+ abstract class BoxingConversions[Boxed, Unboxed] {
+ def box(x: Unboxed): Boxed
+ def unbox(x: Boxed): Unboxed
+ }
+
case class Meter(underlying: Double) extends AnyVal with _root_.b.Printable {
def + (other: Meter): Meter =
new Meter(this.underlying + other.underlying)