Skip to content

Commit ca447e0

Browse files
committed
Debug partest.
1 parent 9222af0 commit ca447e0

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

compiler/test/dotty/partest/DPConsoleRunner.scala

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,16 @@ extends SuiteRunner(testSourcePath, fileManager, updateCheck, failed, javaCmdPat
137137
// Append compiler output to transcript if compilation failed,
138138
// printed with --verbose option
139139
case TestState.Fail(f, r@"compilation failed", transcript) =>
140+
NestUI.echo("1LOG: [[" + runner.logFile.fileContents + "]]")
141+
NestUI.echo("1CLOG: {{" + runner.cLogFile.fileContents + "}}")
142+
NestUI.echo("1TRANS: <<" + runner.transcript + ">>")
140143
TestState.Fail(f, r, transcript ++ runner.cLogFile.fileLines.dropWhile(_ == ""))
141-
case res => res
144+
case res @ TestState.Pass(_) => res
145+
case res =>
146+
NestUI.echo("2LOG: [[" + runner.logFile.fileContents + "]]")
147+
NestUI.echo("2CLOG: {{" + runner.cLogFile.fileContents + "}}")
148+
NestUI.echo("2TRANS: <<" + runner.transcript + ">>")
149+
res
142150
}
143151
} catch {
144152
case t: Throwable => throw new RuntimeException(s"Error running $testFile", t)
@@ -172,6 +180,10 @@ extends SuiteRunner(testSourcePath, fileManager, updateCheck, failed, javaCmdPat
172180
class DPTestRunner(testFile: File, suiteRunner: DPSuiteRunner) extends nest.Runner(testFile, suiteRunner) {
173181
val cLogFile = SFile(logFile).changeExtension("clog")
174182

183+
override def runTestCommon(andAlso: => Boolean): (Boolean, LogContext) = runInContext {
184+
compilationRounds(testFile).forall(x => nextTestActionExpectTrue(s"compilation failed ==${x}==", x.isOk)) && andAlso
185+
}
186+
175187
// override to provide DottyCompiler
176188
override def newCompiler = new dotty.partest.DPDirectCompiler(this)
177189

0 commit comments

Comments
 (0)