diff options
author | liu fengyun <liu@fengy.me> | 2017-04-13 15:03:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-13 15:03:13 +0200 |
commit | fb4adc3c9c55476d2fe0deed22cff54e8e945406 (patch) | |
tree | b7577f66688ed793a73ff543042a140e62cbe80d /compiler/test/dotty/tools/dotc | |
parent | cf37737f56db7bc2f7429f78328dc5eea1716356 (diff) | |
parent | de6461ab17562dbb46a1ff094590e051d03cb54c (diff) | |
download | dotty-fb4adc3c9c55476d2fe0deed22cff54e8e945406.tar.gz dotty-fb4adc3c9c55476d2fe0deed22cff54e8e945406.tar.bz2 dotty-fb4adc3c9c55476d2fe0deed22cff54e8e945406.zip |
Merge branch 'master' into fix-2253
Diffstat (limited to 'compiler/test/dotty/tools/dotc')
-rw-r--r-- | compiler/test/dotty/tools/dotc/CompilationTests.scala | 5 | ||||
-rw-r--r-- | compiler/test/dotty/tools/dotc/reporting/TestReporter.scala | 28 |
2 files changed, 26 insertions, 7 deletions
diff --git a/compiler/test/dotty/tools/dotc/CompilationTests.scala b/compiler/test/dotty/tools/dotc/CompilationTests.scala index fa0c89f28..cf9b200d4 100644 --- a/compiler/test/dotty/tools/dotc/CompilationTests.scala +++ b/compiler/test/dotty/tools/dotc/CompilationTests.scala @@ -156,6 +156,7 @@ class CompilationTests extends ParallelTesting { compileFile("../tests/neg/customArgs/nopredef.scala", defaultOptions.and("-Yno-predef")) + compileFile("../tests/neg/customArgs/noimports.scala", defaultOptions.and("-Yno-imports")) + compileFile("../tests/neg/customArgs/noimports2.scala", defaultOptions.and("-Yno-imports")) + + compileFile("../tests/neg/customArgs/overloadsOnAbstractTypes.scala", allowDoubleBindings) + compileFile("../tests/neg/tailcall/t1672b.scala", defaultOptions) + compileFile("../tests/neg/tailcall/t3275.scala", defaultOptions) + compileFile("../tests/neg/tailcall/t6574.scala", defaultOptions) + @@ -216,9 +217,9 @@ class CompilationTests extends ParallelTesting { val opt = Array( "-classpath", // compile with bootstrapped library on cp: - defaultOutputDir + "lib$1/src/:" + + defaultOutputDir + "lib/src/:" + // as well as bootstrapped compiler: - defaultOutputDir + "dotty1$1/dotty/:" + + defaultOutputDir + "dotty1/dotty/:" + Jars.dottyInterfaces ) diff --git a/compiler/test/dotty/tools/dotc/reporting/TestReporter.scala b/compiler/test/dotty/tools/dotc/reporting/TestReporter.scala index 8645882ca..213181b56 100644 --- a/compiler/test/dotty/tools/dotc/reporting/TestReporter.scala +++ b/compiler/test/dotty/tools/dotc/reporting/TestReporter.scala @@ -91,23 +91,41 @@ extends Reporter with UniqueMessagePositions with HideNonSensicalMessages with M } object TestReporter { - lazy val logWriter = { + private[this] var outFile: JFile = _ + private[this] var logWriter: PrintWriter = _ + + private[this] def initLog() = if (logWriter eq null) { val df = new SimpleDateFormat("yyyy-MM-dd-HH:mm") val timestamp = df.format(new Date) new JFile("../testlogs").mkdirs() - new PrintWriter(new FileOutputStream(new JFile(s"../testlogs/tests-$timestamp.log"), true)) + outFile = new JFile(s"../testlogs/tests-$timestamp.log") + logWriter = new PrintWriter(new FileOutputStream(outFile, true)) } - def writeToLog(str: String) = { + def logPrintln(str: String) = { + initLog() logWriter.println(str) logWriter.flush() } + def logPrint(str: String): Unit = { + initLog() + logWriter.println(str) + } + + def logFlush(): Unit = + if (logWriter ne null) logWriter.flush() + + def logPath: String = { + initLog() + outFile.getCanonicalPath + } + def reporter(ps: PrintStream, logLevel: Int): TestReporter = - new TestReporter(new PrintWriter(ps, true), writeToLog, logLevel) + new TestReporter(new PrintWriter(ps, true), logPrintln, logLevel) def simplifiedReporter(writer: PrintWriter): TestReporter = { - val rep = new TestReporter(writer, writeToLog, WARNING) { + val rep = new TestReporter(writer, logPrintln, WARNING) { /** Prints the message with the given position indication in a simplified manner */ override def printMessageAndPos(m: MessageContainer, extra: String)(implicit ctx: Context): Unit = { def report() = { |