aboutsummaryrefslogtreecommitdiff
path: root/bench/test/dotty/tools/benchmarks/Benchmarks.scala
diff options
context:
space:
mode:
authorliu fengyun <liufengyunchina@gmail.com>2016-11-09 15:58:57 +0100
committerliu fengyun <liu@fengy.me>2016-11-24 13:38:28 +0100
commiteaf6a2201bf29dcb18ea54417c2af89e32d11c4b (patch)
tree65740c049dd19f829e10837552e769953a93c087 /bench/test/dotty/tools/benchmarks/Benchmarks.scala
parenta8c820b8f29c35851e261afe7225d7fce2f6a224 (diff)
downloaddotty-eaf6a2201bf29dcb18ea54417c2af89e32d11c4b.tar.gz
dotty-eaf6a2201bf29dcb18ea54417c2af89e32d11c4b.tar.bz2
dotty-eaf6a2201bf29dcb18ea54417c2af89e32d11c4b.zip
add mini tests to benchmarks
Diffstat (limited to 'bench/test/dotty/tools/benchmarks/Benchmarks.scala')
-rw-r--r--bench/test/dotty/tools/benchmarks/Benchmarks.scala21
1 files changed, 18 insertions, 3 deletions
diff --git a/bench/test/dotty/tools/benchmarks/Benchmarks.scala b/bench/test/dotty/tools/benchmarks/Benchmarks.scala
index fe5517ad9..8be592330 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 {
@@ -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
@@ -74,11 +76,24 @@ object BenchTests extends OnlineRegressionReport {
def setup =
performance of "dotty" in {
measure.method("stdlib") in {
- using(Gen.unit("test")) curve "stdlib" in { r => stdLib }
+ // maybe scalac curve later
+ using(Gen.unit("test")) curve "dotty" in { r => stdLib }
}
measure.method("dotty-src") in {
- using(Gen.unit("test")) curve "dotty-src" in { r => dotty }
+ using(Gen.unit("test")) curve "dotty" 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 {
+ // maybe scalac curve later
+ using(Gen.unit("test")) curve "dotty" in { r =>
+ compiler.compileFile(testDir, name, extension = "")
+ }
+ }
}
}