aboutsummaryrefslogtreecommitdiff
path: root/compiler/test/dotty/tools/dotc
diff options
context:
space:
mode:
authorFelix Mulder <felix.mulder@gmail.com>2017-04-13 11:30:24 +0200
committerGitHub <noreply@github.com>2017-04-13 11:30:24 +0200
commit46e3395693b6f8749aa0b01b41b7d643f3bef5dc (patch)
treed24e149dd111287c80fb35026faafd2cbef5f526 /compiler/test/dotty/tools/dotc
parentd1cbf5fd02ecb7a9531a90014881ad2f416af4fb (diff)
parent3a15365ab25b6ba0fda2c4321b47f9b257dc5aef (diff)
downloaddotty-46e3395693b6f8749aa0b01b41b7d643f3bef5dc.tar.gz
dotty-46e3395693b6f8749aa0b01b41b7d643f3bef5dc.tar.bz2
dotty-46e3395693b6f8749aa0b01b41b7d643f3bef5dc.zip
Merge pull request #2248 from dotty-staging/topic/vulpix-fixes1
Various vulpix fixes
Diffstat (limited to 'compiler/test/dotty/tools/dotc')
-rw-r--r--compiler/test/dotty/tools/dotc/CompilationTests.scala4
-rw-r--r--compiler/test/dotty/tools/dotc/reporting/TestReporter.scala28
2 files changed, 25 insertions, 7 deletions
diff --git a/compiler/test/dotty/tools/dotc/CompilationTests.scala b/compiler/test/dotty/tools/dotc/CompilationTests.scala
index fa0c89f28..ff50d7238 100644
--- a/compiler/test/dotty/tools/dotc/CompilationTests.scala
+++ b/compiler/test/dotty/tools/dotc/CompilationTests.scala
@@ -216,9 +216,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 7952ed728..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 {
- 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() = {