Skip to content

Commit 614cf22

Browse files
committed
suppress summary information to ease parsing of test data
1 parent 92f3cd5 commit 614cf22

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

bench/src/main/scala/Benchmarks.scala

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ package dotty.tools.benchmarks
22

33
import dotty.tools.dotc._
44
import core.Contexts.Context
5+
import dotty.tools.FatalError
6+
import reporting._
57

68
import org.openjdk.jmh.results.RunResult
79
import org.openjdk.jmh.runner.Runner
@@ -85,6 +87,21 @@ class CompilerOptions {
8587
}
8688

8789
class Worker extends Driver {
90+
// override to avoid printing summary information
91+
override def doCompile(compiler: Compiler, fileNames: List[String])(implicit ctx: Context): Reporter =
92+
if (fileNames.nonEmpty)
93+
try {
94+
val run = compiler.newRun
95+
run.compile(fileNames)
96+
ctx.reporter
97+
}
98+
catch {
99+
case ex: FatalError =>
100+
ctx.error(ex.getMessage) // signals that we should fail compilation.
101+
ctx.reporter
102+
}
103+
else ctx.reporter
104+
88105
@Benchmark
89106
def compile(state: CompilerOptions): Unit = {
90107
val res = process(state.opts)

0 commit comments

Comments
 (0)