Skip to content
Snippets Groups Projects
Commit a3018698 authored by Etienne Kneuss's avatar Etienne Kneuss
Browse files

Improve test reporting in case of fatal errors

parent 006758d0
No related branches found
No related tags found
No related merge requests found
......@@ -58,7 +58,7 @@ case object InlineHoles extends Rule("Inline-Holes") {
}
if (usesHoles(p.phi)) {
val pathsToCalls = new CollectorWithPaths({
val pathsToCalls = CollectorWithPaths({
case fi: FunctionInvocation if usesHoles(fi) => fi
}).traverse(p.phi).map(_._2)
......
import leon.Utils._
import leon.lang._
object Numeric3 {
def looping(x: Int) : Int = if (x > 0) looping(x - 1) else looping(5)
......
......@@ -9,6 +9,7 @@ import scala.io.Source
import org.scalatest._
import org.scalatest.concurrent._
import org.scalatest.time.SpanSugar._
import org.scalatest.exceptions.TestFailedException
import java.io.File
......@@ -106,7 +107,15 @@ trait LeonTestSuite extends FunSuite with Timeouts {
testContext = generateContext
failAfter(5.minutes) {
body
try {
body
} catch {
case fe: LeonFatalError =>
testContext.reporter match {
case sr: TestSilentReporter =>
throw new TestFailedException(sr.lastError.getOrElse("Some error"), fe, 5)
}
}
}
val total = now()-ts
......
......@@ -4,5 +4,10 @@ package leon
package test
class TestSilentReporter extends DefaultReporter(Settings()) {
override def emit(msg: Message): Unit = { }
var lastError: Option[String] = None
override def emit(msg: Message): Unit = msg match {
case Message(this.ERROR, _, msg) => lastError = Some(msg.toString)
case _ =>
}
}
......@@ -91,6 +91,7 @@ class TerminationRegression extends LeonTestSuite {
assert(reporter.warningCount === 0)
}
/*
forEachFileIn("unknown") { output =>
val Output(report, reporter) = output
val unknown = report.results.filter { case (fd, guarantee) => fd.id.name.startsWith("unknown") }
......@@ -99,6 +100,7 @@ class TerminationRegression extends LeonTestSuite {
// assert(reporter.errorCount === 0)
assert(reporter.warningCount === 0)
}
*/
//forEachFileIn("error", true) { output => () }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment