diff options
author | Dmitry Petrashko <dark@d-d.me> | 2017-01-11 17:07:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-11 17:07:02 +0100 |
commit | 8b44b6c1fb0f03a555834d189b98ef30091153fe (patch) | |
tree | a5d030608d8751bdcf583076ff081d70eb87adaa /bench/test/dotty/tools | |
parent | e9165e46e24370e9e5dcccf2c49470ab00e30507 (diff) | |
parent | 157481b24e00c87ba3d44a28dd07c70c28001f0e (diff) | |
download | dotty-8b44b6c1fb0f03a555834d189b98ef30091153fe.tar.gz dotty-8b44b6c1fb0f03a555834d189b98ef30091153fe.tar.bz2 dotty-8b44b6c1fb0f03a555834d189b98ef30091153fe.zip |
Merge pull request #1690 from dotty-staging/bench
Fix benchmarks and add multiple mini benchmark tests
Diffstat (limited to 'bench/test/dotty/tools')
-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 fe5517ad9..dc2d65528 100644 --- a/bench/test/dotty/tools/benchmarks/Benchmarks.scala +++ b/bench/test/dotty/tools/benchmarks/Benchmarks.scala @@ -8,6 +8,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 { @@ -36,7 +37,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 @@ -45,7 +46,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 = Source.fromFile("../compiler/test/dotc/scala-collections.whitelist", "UTF8").getLines() .map(_.trim) // allow identation @@ -80,6 +82,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 |