diff options
Diffstat (limited to 'bench/test/dotty/tools/benchmarks/Benchmarks.scala')
-rw-r--r-- | bench/test/dotty/tools/benchmarks/Benchmarks.scala | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/bench/test/dotty/tools/benchmarks/Benchmarks.scala b/bench/test/dotty/tools/benchmarks/Benchmarks.scala index 242d60788..04e7e25d7 100644 --- a/bench/test/dotty/tools/benchmarks/Benchmarks.scala +++ b/bench/test/dotty/tools/benchmarks/Benchmarks.scala @@ -9,6 +9,7 @@ import org.scalameter.reporting.RegressionReporter.Tester import dotty.tools.dotc.CompilerTest import scala.io.Source +import scala.reflect.io.Directory // decorator of persitor to expose info for debugging class DecoratorPersistor(p: Persistor) extends SerializationPersistor { @@ -37,7 +38,7 @@ class DecoratorPersistor(p: Persistor) extends SerializationPersistor { } object BenchTests extends OnlineRegressionReport { - val outputDir = "./out/" + val outputDir = "../out/" val compiler = new CompilerTest { override val defaultOutputDir: String = outputDir @@ -46,7 +47,8 @@ object BenchTests extends OnlineRegressionReport { implicit val defaultOptions = List("-d", outputDir) val scala2mode = List("-language:Scala2") - val dottyDir = "../compiler/src/dotty/" + val dottyDir = "../compiler/src/dotty/" + val testDir = "../bench/tests/" val stdlibFiles = StdLibSources.whitelisted @@ -75,6 +77,17 @@ object BenchTests extends OnlineRegressionReport { measure.method("dotty-src") in { using(Gen.unit("test")) curve "dotty-src" in { r => dotty } } + + val dir = Directory(testDir) + val fileNames = dir.files.toArray.map(_.jfile.getName).filter(name => (name endsWith ".scala")) + + for (name <- fileNames) { + measure.method(name) in { + using(Gen.unit("test")) curve "dotty" in { r => + compiler.compileFile(testDir, name, extension = "") + } + } + } } /** workaround to fix problem in ScalaMeter |