aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.drone.yml14
-rw-r--r--.drone.yml.sig2
-rw-r--r--compiler/test/dotc/comptest.scala1
-rw-r--r--compiler/test/dotty/tools/dotc/CompilationTests.scala3
-rw-r--r--compiler/test/dotty/tools/dotc/ParallelTestTests.scala2
-rw-r--r--compiler/test/dotty/tools/dotc/ParallelTesting.scala66
-rw-r--r--project/Build.scala12
7 files changed, 68 insertions, 32 deletions
diff --git a/.drone.yml b/.drone.yml
index eb36e65d8..520c4049e 100644
--- a/.drone.yml
+++ b/.drone.yml
@@ -6,7 +6,7 @@ pipeline:
- ln -s /var/cache/drone/scala-scala scala-scala
- ln -s /var/cache/drone/ivy2 "$HOME/.ivy2"
- ./scripts/update-scala-library
- - sbt -J-Xmx4096m -J-XX:ReservedCodeCacheSize=512m -J-XX:MaxMetaspaceSize=1024m -Ddotty.drone.mem=4096m "${TEST}"
+ - sbt -J-Xmx24G -J-XX:ReservedCodeCacheSize=512m -J-XX:MaxMetaspaceSize=4G -Ddotty.drone.mem=4096m "${TEST}"
when:
branch:
exclude: gh-pages
@@ -34,9 +34,9 @@ pipeline:
matrix:
TEST:
- - ;test;dotty-bin-tests/test
- - ;publishLocal;dotty-bootstrapped/test
- - partest-only-no-bootstrap --show-diff --verbose
- - partest-only --show-diff --verbose
- - ;set testOptions in LocalProject("dotty-compiler") := Seq() ;dotty-compiler/testOnly dotty.tools.dotc.CompilationTests
- - ;publishLocal ;set testOptions in LocalProject("dotty-compiler-bootstrapped") := Seq() ;dotty-bootstrapped/testOnly dotty.tools.dotc.CompilationTests
+ - ;set testOptions in LocalProject("dotty-compiler") += Tests.Argument(TestFrameworks.JUnit, "--exclude-categories=dotty.tools.dotc.ParallelTesting") ;test ;dotty-bin-tests/test
+ - ;set testOptions in LocalProject("dotty-compiler-bootstrapped") += Tests.Argument(TestFrameworks.JUnit, "--exclude-categories=dotty.tools.dotc.ParallelTesting") ;publishLocal ;dotty-bootstrapped/test
+ - ;set testOptions in LocalProject("dotty-compiler") += Tests.Argument(TestFrameworks.JUnit, "--exclude-categories=dotty.tools.dotc.ParallelTesting") ;partest-only-no-bootstrap --show-diff --verbose
+ - ;set testOptions in LocalProject("dotty-compiler-bootstrapped") += Tests.Argument(TestFrameworks.JUnit, "--exclude-categories=dotty.tools.dotc.ParallelTesting") ;partest-only --show-diff --verbose
+ - ;dotty-compiler/testOnly dotty.tools.dotc.CompilationTests
+ - ;publishLocal ;dotty-bootstrapped/testOnly dotty.tools.dotc.CompilationTests
diff --git a/.drone.yml.sig b/.drone.yml.sig
index b823296fa..329cd5b7c 100644
--- a/.drone.yml.sig
+++ b/.drone.yml.sig
@@ -1 +1 @@
-eyJhbGciOiJIUzI1NiJ9.cGlwZWxpbmU6CiAgdGVzdDoKICAgIGltYWdlOiBsYW1wZXBmbC9kb3R0eTpsYXRlc3QKICAgIHB1bGw6IHRydWUKICAgIGNvbW1hbmRzOgogICAgICAtIGxuIC1zIC92YXIvY2FjaGUvZHJvbmUvc2NhbGEtc2NhbGEgc2NhbGEtc2NhbGEKICAgICAgLSBsbiAtcyAvdmFyL2NhY2hlL2Ryb25lL2l2eTIgIiRIT01FLy5pdnkyIgogICAgICAtIC4vc2NyaXB0cy91cGRhdGUtc2NhbGEtbGlicmFyeQogICAgICAtIHNidCAtSi1YbXg0MDk2bSAtSi1YWDpSZXNlcnZlZENvZGVDYWNoZVNpemU9NTEybSAtSi1YWDpNYXhNZXRhc3BhY2VTaXplPTEwMjRtIC1EZG90dHkuZHJvbmUubWVtPTQwOTZtICIke1RFU1R9IgogICAgd2hlbjoKICAgICAgYnJhbmNoOgogICAgICAgIGV4Y2x1ZGU6IGdoLXBhZ2VzCgogIGRvY3VtZW50YXRpb246CiAgICBpbWFnZTogbGFtcGVwZmwvZG90dHk6bGF0ZXN0CiAgICBwdWxsOiB0cnVlCiAgICBjb21tYW5kczoKICAgICAgLSAuL3Byb2plY3Qvc2NyaXB0cy9nZW5Eb2NzICIke1RFU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ZXN0T25seSBkb3R0eS50b29scy5kb3RjLkNvbXBpbGF0aW9uVGVzdHMK.IAe3X-XmMyf3-GnA1ENr-D3t_YM_28CAhHX6lP0EB6E \ No newline at end of file
diff --git a/compiler/test/dotc/comptest.scala b/compiler/test/dotc/comptest.scala
index c2c88abb3..279660eef 100644
--- a/compiler/test/dotc/comptest.scala
+++ b/compiler/test/dotc/comptest.scala
@@ -5,6 +5,7 @@ import dotty.tools.dotc.ParallelTesting
object comptest extends ParallelTesting {
def interactive: Boolean = true
+ def regex: Option[String] = None
implicit val defaultOutputDir: String = "."
diff --git a/compiler/test/dotty/tools/dotc/CompilationTests.scala b/compiler/test/dotty/tools/dotc/CompilationTests.scala
index 83713748c..93ddab057 100644
--- a/compiler/test/dotty/tools/dotc/CompilationTests.scala
+++ b/compiler/test/dotty/tools/dotc/CompilationTests.scala
@@ -7,13 +7,14 @@ import java.io.{ File => JFile }
import org.junit.experimental.categories.Category
-
@Category(Array(classOf[ParallelTesting]))
class CompilationTests extends ParallelTesting {
import CompilationTests._
def interactive: Boolean = !sys.env.contains("DRONE")
+ def regex: Option[String] = sys.props.get("dotty.partest.filter")
+
// Positive tests ------------------------------------------------------------
@Test def compilePos: Unit = {
diff --git a/compiler/test/dotty/tools/dotc/ParallelTestTests.scala b/compiler/test/dotty/tools/dotc/ParallelTestTests.scala
index 572f63410..a22df0ace 100644
--- a/compiler/test/dotty/tools/dotc/ParallelTestTests.scala
+++ b/compiler/test/dotty/tools/dotc/ParallelTestTests.scala
@@ -12,6 +12,8 @@ class ParallelTestTests extends ParallelTesting {
def interactive: Boolean = !sys.env.contains("DRONE")
+ def regex: Option[String] = None
+
@Test def missingFile: Unit =
try {
compileFile("../tests/partest-test/i-dont-exist.scala", defaultOptions).expectFailure.neg()
diff --git a/compiler/test/dotty/tools/dotc/ParallelTesting.scala b/compiler/test/dotty/tools/dotc/ParallelTesting.scala
index b4452299b..2123e7657 100644
--- a/compiler/test/dotty/tools/dotc/ParallelTesting.scala
+++ b/compiler/test/dotty/tools/dotc/ParallelTesting.scala
@@ -14,6 +14,7 @@ import scala.io.Source
import scala.util.control.NonFatal
import scala.util.Try
import scala.collection.mutable
+import scala.util.matching.Regex
import core.Contexts._
import reporting.{ Reporter, TestReporter }
@@ -25,6 +26,10 @@ trait ParallelTesting {
def interactive: Boolean
+ def regex: Option[String]
+
+ private lazy val filter: Option[Regex] = regex.map(str => new Regex(str))
+
private sealed trait Target { self =>
def outDir: JFile
def flags: Array[String]
@@ -121,7 +126,16 @@ trait ParallelTesting {
/** Actual compilation run logic, the test behaviour is defined here */
protected def compilationRunnable(target: Target): Runnable
- val totalTargets = targets.length
+ private val allTargets =
+ if (!filter.isDefined) targets
+ else targets.filter {
+ case ConcurrentCompilationTarget(files, _, _) =>
+ files.exists(file => filter.get.findFirstIn(file.getAbsolutePath).isDefined)
+ case SeparateCompilationTarget(dir, _, _) =>
+ filter.get.findFirstIn(dir.getAbsolutePath).isDefined
+ }
+
+ val totalTargets = allTargets.length
private[this] var _errors = 0
def errors: Int = synchronized { _errors }
@@ -271,31 +285,39 @@ trait ParallelTesting {
private[ParallelTesting] def execute(): this.type = {
assert(_targetsCompiled == 0, "not allowed to re-use a `CompileRun`")
- val pool = threadLimit match {
- case Some(i) => JExecutors.newWorkStealingPool(i)
- case None => JExecutors.newWorkStealingPool()
- }
- if (interactive && !suppressAllOutput) pool.submit(statusRunner)
+ if (allTargets.nonEmpty) {
+ val pool = threadLimit match {
+ case Some(i) => JExecutors.newWorkStealingPool(i)
+ case None => JExecutors.newWorkStealingPool()
+ }
- targets.foreach { target =>
- pool.submit(compilationRunnable(target))
- }
+ if (interactive && !suppressAllOutput) pool.submit(statusRunner)
- pool.shutdown()
- if (!pool.awaitTermination(10, TimeUnit.MINUTES))
- throw new TimeoutException("Compiling targets timed out")
-
- if (didFail) {
- echo {
- """|
- |================================================================================
- |Test Report
- |================================================================================
- |Failing tests:""".stripMargin
+ allTargets.foreach { target =>
+ pool.submit(compilationRunnable(target))
}
- failedCompilationTargets.toArray.sorted.foreach(echo)
- failureInstructions.iterator.foreach(echo)
+
+ pool.shutdown()
+ if (!pool.awaitTermination(10, TimeUnit.MINUTES))
+ throw new TimeoutException("Compiling targets timed out")
+
+ if (didFail) {
+ echo {
+ """|
+ |================================================================================
+ |Test Report
+ |================================================================================
+ |Failing tests:""".stripMargin
+ }
+ failedCompilationTargets.toArray.sorted.foreach(echo)
+ failureInstructions.iterator.foreach(echo)
+ }
+ }
+ else echo {
+ regex
+ .map(r => s"""No files matched regex "$r" in test""")
+ .getOrElse("No tests available under target - erroneous test?")
}
this
diff --git a/project/Build.scala b/project/Build.scala
index baebaedf5..bb02416cc 100644
--- a/project/Build.scala
+++ b/project/Build.scala
@@ -47,6 +47,9 @@ object Build {
// Spawns a repl with the correct classpath
lazy val repl = inputKey[Unit]("run the REPL with correct classpath")
+ // Run tests with filter
+ lazy val filterTest = inputKey[Unit]("runs integration test with the supplied filter")
+
// Used to compile files similar to ./bin/dotc script
lazy val dotc =
inputKey[Unit]("run the compiler using the correct classpath, or the user supplied classpath")
@@ -288,7 +291,6 @@ object Build {
libraryDependencies += "org.scala-lang.modules" %% "scala-partest" % "1.0.11" % "test",
testOptions in Test += Tests.Cleanup({ () => partestLockFile.delete }),
// this option is needed so that partest doesn't run
- testOptions += Tests.Argument(TestFrameworks.JUnit, "--exclude-categories=dotty.tools.dotc.ParallelTesting"),
partestDeps := Seq(
scalaCompiler,
"org.scala-lang" % "scala-reflect" % scalacVersion,
@@ -338,6 +340,14 @@ object Build {
)
}.evaluated,
+ filterTest := Def.inputTaskDyn {
+ val args: Seq[String] = spaceDelimited("<arg>").parsed
+ testOptions := Seq()
+ (testOnly in Test).toTask(
+ " dotty.tools.dotc.CompilationTests -- -Ddotty.partest.filter=" + args.head
+ )
+ }.evaluated,
+
// Override run to be able to run compiled classfiles
dotr := {
val args: Seq[String] = spaceDelimited("<arg>").parsed