-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reproduce problem where error disappeared
When the javadoc tool fails with an error that could not be parsed, the error is silently dropped.
- Loading branch information
Showing
2 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
internal/zinc-compile-core/src/test/scala/sbt/internal/inc/javac/CollectingReporter.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package sbt | ||
package internal | ||
package inc | ||
package javac | ||
|
||
import xsbti.Reporter | ||
import xsbti.Problem | ||
|
||
class CollectingReporter extends Reporter { | ||
var problems: Array[Problem] = Array[Problem]() | ||
|
||
def reset() = problems = Array[Problem]() | ||
def hasErrors() = ??? | ||
def hasWarnings(): Boolean = ??? | ||
def printSummary(): Unit = ??? | ||
def log(problem: xsbti.Problem): Unit = problems :+= problem | ||
def comment(pos: xsbti.Position, msg: String): Unit = ??? | ||
|
||
} |
20 changes: 20 additions & 0 deletions
20
...rnal/zinc-compile-core/src/test/scala/sbt/internal/inc/javac/JavacProcessLoggerSpec.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package sbt | ||
package internal | ||
package inc | ||
package javac | ||
|
||
import java.io.File | ||
|
||
class JavaProcessLoggerSpec extends UnitSpec { | ||
"The javac process logger" should "log errors that could not be parsed" in logUnparsableErrors() | ||
|
||
def logUnparsableErrors() = { | ||
val reporter = new CollectingReporter() | ||
val logger = new JavacLogger(log = null, reporter, cwd = new File(".")) | ||
logger.err("javadoc: error - invalid flag: -target") | ||
|
||
logger.flush(-1) | ||
|
||
reporter.problems.length should be(1) | ||
} | ||
} |