summaryrefslogtreecommitdiff
path: root/scalaplugin/src/test
diff options
context:
space:
mode:
authorLi Haoyi <haoyi.sg@gmail.com>2017-11-27 09:02:05 -0800
committerLi Haoyi <haoyi.sg@gmail.com>2017-11-27 09:02:05 -0800
commit77bef2c92936ec7ba0603a0470380906f247e482 (patch)
tree076d3f213eeec9ca3f222fc6cd02cc89f1408364 /scalaplugin/src/test
parentc6d95ab024831bd5f12d9aff2cacc361b9acfa1c (diff)
downloadmill-77bef2c92936ec7ba0603a0470380906f247e482.tar.gz
mill-77bef2c92936ec7ba0603a0470380906f247e482.tar.bz2
mill-77bef2c92936ec7ba0603a0470380906f247e482.zip
Acyclic cross-version tests are running
Diffstat (limited to 'scalaplugin/src/test')
-rw-r--r--scalaplugin/src/test/scala/mill/scalaplugin/AcyclicTests.scala18
1 files changed, 16 insertions, 2 deletions
diff --git a/scalaplugin/src/test/scala/mill/scalaplugin/AcyclicTests.scala b/scalaplugin/src/test/scala/mill/scalaplugin/AcyclicTests.scala
index 1f0bbd7e..5537037f 100644
--- a/scalaplugin/src/test/scala/mill/scalaplugin/AcyclicTests.scala
+++ b/scalaplugin/src/test/scala/mill/scalaplugin/AcyclicTests.scala
@@ -61,8 +61,22 @@ object AcyclicTests extends TestSuite{
}
val packageScala = workspacePath/'src/'main/'scala/'acyclic/"package.scala"
- 'acyclic - {
- val scalaVersion = "2.12.4"
+ 'scala210 - check("2.10.6")
+ 'scala211 - check("2.11.8")
+ 'scala212 - check("2.12.4")
+
+ val allBinaryVersions = Seq("2.10", "2.11", "2.12")
+ def check(scalaVersion: String) = {
+ // Dependencies are right; make sure every dependency is of the correct
+ // binary Scala version, except for the compiler-bridge which is of the
+ // same version as the host classpath.
+ val Right((compileDepClasspath, _)) = eval(AcyclicBuild.acyclic(scalaVersion).compileDepClasspath)
+ val binaryScalaVersion = scalaVersion.split('.').dropRight(1).mkString(".")
+ val compileDeps = compileDepClasspath.map(_.path.toString())
+ val offBinaryVersions = allBinaryVersions.filter(_ != binaryScalaVersion)
+ val offVersionedDeps = compileDeps.filter(p => offBinaryVersions.exists(p.contains))
+ assert(offVersionedDeps.forall(_.contains("compiler-bridge")))
+
// We can compile
val Right((pathRef, evalCount)) = eval(AcyclicBuild.acyclic(scalaVersion).compile)
val outputPath = pathRef.path