aboutsummaryrefslogtreecommitdiff
path: root/compiler/test/dotty/tools/dotc/CompilationTests.scala
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/test/dotty/tools/dotc/CompilationTests.scala')
-rw-r--r--compiler/test/dotty/tools/dotc/CompilationTests.scala42
1 files changed, 38 insertions, 4 deletions
diff --git a/compiler/test/dotty/tools/dotc/CompilationTests.scala b/compiler/test/dotty/tools/dotc/CompilationTests.scala
index a5914bf4d..334d347fc 100644
--- a/compiler/test/dotty/tools/dotc/CompilationTests.scala
+++ b/compiler/test/dotty/tools/dotc/CompilationTests.scala
@@ -4,11 +4,15 @@ package dotc
import org.junit.{ Test, BeforeClass, AfterClass }
+import java.nio.file._
+import java.util.stream.{ Stream => JStream }
+import scala.collection.JavaConverters._
import scala.util.matching.Regex
import scala.concurrent.duration._
import vulpix.{ ParallelTesting, SummaryReport, SummaryReporting, TestConfiguration }
+
class CompilationTests extends ParallelTesting {
import TestConfiguration._
import CompilationTests._
@@ -219,7 +223,7 @@ class CompilationTests extends ParallelTesting {
// compile with bootstrapped library on cp:
defaultOutputDir + "lib/src/:" +
// as well as bootstrapped compiler:
- defaultOutputDir + "dotty1/dotty/:" +
+ defaultOutputDir + "dotty1/dotty1/:" +
Jars.dottyInterfaces
)
@@ -227,8 +231,36 @@ class CompilationTests extends ParallelTesting {
compileDir("../library/src",
allowDeepSubtypes.and("-Ycheck-reentrant", "-strict", "-priorityclasspath", defaultOutputDir))
- def dotty1 =
- compileDir("../compiler/src/dotty", opt)
+ def sources(paths: JStream[Path], excludedFiles: List[String] = Nil): List[String] =
+ paths.iterator().asScala
+ .filter(path =>
+ (path.toString.endsWith(".scala") || path.toString.endsWith(".java"))
+ && !excludedFiles.contains(path.getFileName.toString))
+ .map(_.toString).toList
+
+ val compilerDir = Paths.get("../compiler/src")
+ val compilerSources = sources(Files.walk(compilerDir))
+
+ val backendDir = Paths.get("../scala-backend/src/compiler/scala/tools/nsc/backend")
+ val backendJvmDir = Paths.get("../scala-backend/src/compiler/scala/tools/nsc/backend/jvm")
+
+ // NOTE: Keep these exclusions synchronized with the ones in the sbt build (Build.scala)
+ val backendExcluded =
+ List("JavaPlatform.scala", "Platform.scala", "ScalaPrimitives.scala")
+ val backendJvmExcluded =
+ List("BCodeICodeCommon.scala", "GenASM.scala", "GenBCode.scala", "ScalacBackendInterface.scala")
+
+ val backendSources =
+ sources(Files.list(backendDir), excludedFiles = backendExcluded)
+ val backendJvmSources =
+ sources(Files.list(backendJvmDir), excludedFiles = backendJvmExcluded)
+
+ def dotty1 = {
+ compileList(
+ "dotty1",
+ compilerSources ++ backendSources ++ backendJvmSources,
+ opt)
+ }
def dotty2 =
compileShallowFilesInDir("../compiler/src/dotty", opt)
@@ -247,7 +279,9 @@ class CompilationTests extends ParallelTesting {
compileShallowFilesInDir("../compiler/src/dotty/tools/dotc/rewrite", opt) +
compileShallowFilesInDir("../compiler/src/dotty/tools/dotc/transform", opt) +
compileShallowFilesInDir("../compiler/src/dotty/tools/dotc/typer", opt) +
- compileShallowFilesInDir("../compiler/src/dotty/tools/dotc/util", opt)
+ compileShallowFilesInDir("../compiler/src/dotty/tools/dotc/util", opt) +
+ compileList("shallow-backend", backendSources, opt) +
+ compileList("shallow-backend-jvm", backendJvmSources, opt)
} :: Nil
}.map(_.checkCompile()).foreach(_.delete())
}