Skip to content

Commit

Permalink
Fix LibrarySuite test
Browse files Browse the repository at this point in the history
  • Loading branch information
mbovel committed Dec 11, 2024
1 parent 8d9d614 commit fd1a5bd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion frontends/common/src/it/scala/stainless/LibrarySuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ abstract class AbstractLibrarySuite(opts: Seq[inox.OptionValue[?]]) extends AnyF
val ctx: inox.Context = stainless.TestContext(options)
import ctx.{reporter, given}

val tryProgram = scala.util.Try(loadFiles(Seq.empty)._2)
val tryProgram = scala.util.Try(loadFiles(Main.libraryFiles)._2)
it("should be extractable") {
assert(tryProgram.isSuccess, "Extraction crashed with exception")
assert(reporter.errorCount == 0, "Extraction had errors")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import inox.DebugSection

import java.io.File
import java.net.URL
import DottyReporter.NoReporter

class DottyCompiler(ctx: inox.Context, callback: CallBack) extends Compiler {
override def phases: List[List[Phase]] = {
Expand Down Expand Up @@ -72,10 +73,13 @@ class DottyCompiler(ctx: inox.Context, callback: CallBack) extends Compiler {
}
}

private class DottyDriver(args: Seq[String], compiler: DottyCompiler, reporter: DottyReporter) extends Driver {
private class DottyDriver(args: Seq[String], compiler: DottyCompiler, reporter: SimpleReporter) extends Driver {
override def newCompiler(using DottyContext) = compiler

lazy val files: List[String] = setup(args.toArray, initCtx).map(_._1.map(_.path)).getOrElse(Nil)
lazy val files: List[String] =
setup(args.toArray, initCtx.fresh.setReporter(NoReporter))
.map(_._1.map(_.path))
.getOrElse(reporter.reporter.internalError(f"Error parsing arguments from ${args.toList}"))

def run(): Unit = process(args.toArray, reporter)
}
Expand Down

0 comments on commit fd1a5bd

Please sign in to comment.