Skip to content
Snippets Groups Projects
Commit c44d861f authored by Régis Blanc's avatar Régis Blanc
Browse files

run error tests

parent 7bcd4243
No related branches found
No related tags found
No related merge requests found
...@@ -26,7 +26,7 @@ class XLangVerificationRegression extends FunSuite { ...@@ -26,7 +26,7 @@ class XLangVerificationRegression extends FunSuite {
xlang.FunctionClosure andThen xlang.FunctionClosure andThen
leon.verification.AnalysisPhase leon.verification.AnalysisPhase
private def mkTest(file : File)(block: Output=>Unit) = { private def mkTest(file : File, forError: Boolean = false)(block: Output=>Unit) = {
val fullName = file.getPath() val fullName = file.getPath()
val start = fullName.indexOf("regression") val start = fullName.indexOf("regression")
...@@ -55,22 +55,32 @@ class XLangVerificationRegression extends FunSuite { ...@@ -55,22 +55,32 @@ class XLangVerificationRegression extends FunSuite {
val pipeline = mkPipeline val pipeline = mkPipeline
val report = pipeline.run(ctx)(file.getPath :: Nil) if(forError) {
intercept[LeonFatalError]{
pipeline.run(ctx)(file.getPath :: Nil)
}
} else {
val report = pipeline.run(ctx)(file.getPath :: Nil)
block(Output(report, ctx.reporter))
}
block(Output(report, ctx.reporter))
} }
} }
private def forEachFileIn(cat : String)(block : Output=>Unit) { private def forEachFileIn(cat : String, forError: Boolean = false)(block : Output=>Unit) {
val fs = filesInResourceDir( val fs = filesInResourceDir(
"regression/verification/xlang/" + cat, "regression/verification/xlang/" + cat,
_.endsWith(".scala")) _.endsWith(".scala"))
for(f <- fs) { for(f <- fs) {
mkTest(f)(block) mkTest(f, forError)(block)
} }
} }
forEachFileIn("error", true) { output => () }
forEachFileIn("valid") { output => forEachFileIn("valid") { output =>
val Output(report, reporter) = output val Output(report, reporter) = output
assert(report.totalConditions === report.totalValid, assert(report.totalConditions === report.totalValid,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment