diff options
author | Guillaume Martres <smarter@ubuntu.com> | 2017-04-13 21:14:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-13 21:14:28 +0200 |
commit | 9e45ad16d012e6a2ff3be411c2fe101b1c74b831 (patch) | |
tree | 3f8af20f82bbee9ace7f5a39f97f9b64778b38b4 /compiler/test/dotty/tools | |
parent | 975f7efab69e8e5a23db665f33dceecb0bf6ceaa (diff) | |
parent | 476778612e71379cf648693f7d02039301fb5607 (diff) | |
download | dotty-9e45ad16d012e6a2ff3be411c2fe101b1c74b831.tar.gz dotty-9e45ad16d012e6a2ff3be411c2fe101b1c74b831.tar.bz2 dotty-9e45ad16d012e6a2ff3be411c2fe101b1c74b831.zip |
Merge pull request #2260 from dotty-staging/backend-submodule
Fix #2184: Hyper Bootstrap! Integrate the backend as a git submodule
Diffstat (limited to 'compiler/test/dotty/tools')
-rw-r--r-- | compiler/test/dotty/tools/TypeStealer.scala | 21 | ||||
-rw-r--r-- | compiler/test/dotty/tools/backend/jvm/DottyBytecodeTest.scala | 2 | ||||
-rw-r--r-- | compiler/test/dotty/tools/dotc/CompilationTests.scala | 42 |
3 files changed, 39 insertions, 26 deletions
diff --git a/compiler/test/dotty/tools/TypeStealer.scala b/compiler/test/dotty/tools/TypeStealer.scala deleted file mode 100644 index ccaf2d41e..000000000 --- a/compiler/test/dotty/tools/TypeStealer.scala +++ /dev/null @@ -1,21 +0,0 @@ -package dotty.tools - -import scala.tools.nsc.interpreter._ -import scala.tools.nsc.Settings - -object TypeStealer { - def main(args: Array[String]): Unit = { - def repl = new ILoop {} - - val settings = new Settings - settings.Yreplsync.value = true - - //use when launching normally outside SBT - settings.usejavacp.value = true - - //an alternative to 'usejavacp' setting, when launching from within SBT - //settings.embeddedDefaults[Repl.type] - - repl.process(settings) - } -} diff --git a/compiler/test/dotty/tools/backend/jvm/DottyBytecodeTest.scala b/compiler/test/dotty/tools/backend/jvm/DottyBytecodeTest.scala index fc9853691..c423089d0 100644 --- a/compiler/test/dotty/tools/backend/jvm/DottyBytecodeTest.scala +++ b/compiler/test/dotty/tools/backend/jvm/DottyBytecodeTest.scala @@ -11,7 +11,7 @@ import asm._ import asm.tree._ import scala.collection.JavaConverters._ -import scala.tools.nsc.util.JavaClassPath +import io.JavaClassPath import scala.collection.JavaConverters._ import scala.tools.asm.{ClassWriter, ClassReader} import scala.tools.asm.tree._ 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()) } |