File tree 1 file changed +17
-0
lines changed
1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ package dotty.tools.benchmarks
2
2
3
3
import dotty .tools .dotc ._
4
4
import core .Contexts .Context
5
+ import dotty .tools .FatalError
6
+ import reporting ._
5
7
6
8
import org .openjdk .jmh .results .RunResult
7
9
import org .openjdk .jmh .runner .Runner
@@ -85,6 +87,21 @@ class CompilerOptions {
85
87
}
86
88
87
89
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
+
88
105
@ Benchmark
89
106
def compile (state : CompilerOptions ): Unit = {
90
107
val res = process(state.opts)
You can’t perform that action at this time.
0 commit comments