Skip to content

Commit

Permalink
suppress summary information to ease parsing of test data
Browse files Browse the repository at this point in the history
  • Loading branch information
liufengyun committed Aug 27, 2018
1 parent 92f3cd5 commit 614cf22
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions bench/src/main/scala/Benchmarks.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package dotty.tools.benchmarks

import dotty.tools.dotc._
import core.Contexts.Context
import dotty.tools.FatalError
import reporting._

import org.openjdk.jmh.results.RunResult
import org.openjdk.jmh.runner.Runner
Expand Down Expand Up @@ -85,6 +87,21 @@ class CompilerOptions {
}

class Worker extends Driver {
// override to avoid printing summary information
override def doCompile(compiler: Compiler, fileNames: List[String])(implicit ctx: Context): Reporter =
if (fileNames.nonEmpty)
try {
val run = compiler.newRun
run.compile(fileNames)
ctx.reporter
}
catch {
case ex: FatalError =>
ctx.error(ex.getMessage) // signals that we should fail compilation.
ctx.reporter
}
else ctx.reporter

@Benchmark
def compile(state: CompilerOptions): Unit = {
val res = process(state.opts)
Expand Down

0 comments on commit 614cf22

Please sign in to comment.