-
-
Save barambani/4289e6ef62cfecdf42fe371d675d143e to your computer and use it in GitHub Desktop.
Setup for local integration (ie. compile pos/neg/run) tests for lampepfl/dotty
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Build._ | |
import Modes._ | |
addCommandAlias("local-tests", "local-tests/test") | |
lazy val `local-tests` = project.in(file("local") / "localtests") | |
.asDottyCompiler(NonBootstrapped) | |
.dependsOn(`dotty-compiler` % "compile->compile;test->test") | |
.settings(Seq( | |
baseDirectory in (Compile, run) := baseDirectory.value / ".." / "..", | |
baseDirectory in Test := baseDirectory.value / ".." / ".." | |
)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// local/localtests/test/localtests/LocalTests.scala | |
package localtests | |
import java.nio.file._ | |
import java.util.stream.{ Stream => JStream } | |
import org.junit.{ AfterClass, Test } | |
import scala.collection.JavaConverters._ | |
import scala.concurrent.duration._ | |
import dotty.Properties | |
import dotty.tools.dotc.CompilationTests | |
import dotty.tools.vulpix._ | |
class LocalCompilationTests extends ParallelTesting { | |
import TestConfiguration._ | |
import LocalCompilationTests._ | |
// Test suite configuration -------------------------------------------------- | |
def maxDuration = 30.seconds | |
def numberOfSlaves = 5 | |
def safeMode = Properties.testsSafeMode | |
def isInteractive = false // SummaryReport.isInteractive | |
def testFilter = Properties.testsFilter | |
@Test def pos: Unit = { | |
implicit val testGroup: TestGroup = TestGroup("pos") | |
compileFile("tests/pos/byname-implicits-1.scala", defaultOptions.and( | |
"-Xmin-implicit-search-depth", "10" | |
)) | |
}.checkCompile() | |
@Test def neg: Unit = { | |
implicit val testGroup: TestGroup = TestGroup("neg") | |
compileFile("tests/neg/implicitDivergenc.scala", defaultOptions.and( | |
"-Xmin-implicit-search-depth", "5" | |
)) | |
}.checkExpectedErrors() | |
} | |
object LocalCompilationTests { | |
implicit val summaryReport: SummaryReporting = new SummaryReport | |
@AfterClass def cleanup(): Unit = summaryReport.echoSummary() | |
def sources(paths: JStream[Path], excludedFiles: List[String] = Nil): List[String] = { | |
val sources = paths.iterator().asScala | |
.filter(path => | |
(path.toString.endsWith(".scala") || path.toString.endsWith(".java")) | |
&& !excludedFiles.contains(path.getFileName.toString)) | |
.map(_.toString).toList | |
paths.close() | |
sources | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment