File tree 5 files changed +33
-4
lines changed
scalafix-testkit/src/main/scala/scalafix/testkit
output-dotty/src/main/scala/test
unit/src/test/scala/scalafix/tests
5 files changed +33
-4
lines changed Original file line number Diff line number Diff line change @@ -260,6 +260,17 @@ lazy val testsOutput = project
260
260
)
261
261
.dependsOn(testsShared)
262
262
263
+ lazy val testsOutputDotty = project
264
+ .in(file(" scalafix-tests/output-dotty" ))
265
+ .settings(
266
+ allSettings,
267
+ noPublish,
268
+ scalaVersion := " 0.1.1-bin-20170530-f8f52cc-NIGHTLY" ,
269
+ libraryDependencies := libraryDependencies.value.map(_.withDottyCompat()),
270
+ scalacOptions := Nil
271
+ )
272
+ .disablePlugins(ScalahostSbtPlugin )
273
+
263
274
lazy val unit = project
264
275
.in(file(" scalafix-tests/unit" ))
265
276
.settings(
@@ -282,6 +293,8 @@ lazy val unit = project
282
293
sourceDirectory.in(testsInput, Compile ).value,
283
294
" outputSourceroot" ->
284
295
sourceDirectory.in(testsOutput, Compile ).value,
296
+ " outputDottySourceroot" ->
297
+ sourceDirectory.in(testsOutputDotty, Compile ).value,
285
298
" testsInputResources" -> resourceDirectory.in(testsInput, Compile ).value,
286
299
" mirrorClasspath" -> classDirectory.in(testsInput, Compile ).value
287
300
),
Original file line number Diff line number Diff line change @@ -3,11 +3,11 @@ addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.6.1")
3
3
resolvers += Resolver .bintrayIvyRepo(" scalameta" , " sbt-plugins" ) // only needed for scalatex 0.3.8-pre
4
4
addSbtPlugin(" com.lihaoyi" % " scalatex-sbt-plugin" % " 0.3.8-pre" )
5
5
addSbtPlugin(" io.get-coursier" % " sbt-coursier" % " 1.0.0-M15" )
6
- addSbtPlugin(" org.wartremover" % " sbt-wartremover" % " 1.2.1" )
7
6
addSbtPlugin(" com.jsuereth" % " sbt-pgp" % " 1.0.0" )
8
7
addSbtPlugin(" org.xerial.sbt" % " sbt-sonatype" % " 1.1" )
9
8
addSbtPlugin(" me.lessis" % " bintray-sbt" % " 0.3.0" )
10
9
addSbtPlugin(" com.dwijnand" % " sbt-dynver" % " 1.2.0" )
10
+ addSbtPlugin(" ch.epfl.lamp" % " sbt-dotty" % " 0.1.1" )
11
11
addSbtPlugin(" org.scalameta" % " sbt-scalahost" % Dependencies .scalametaV)
12
12
13
13
resolvers += Resolver .bintrayIvyRepo(" duhemm" , " sbt-plugins" )
Original file line number Diff line number Diff line change @@ -2,13 +2,14 @@ package scalafix
2
2
package testkit
3
3
4
4
import scala .meta ._
5
+ import org .scalameta .logger
5
6
import org .scalatest .BeforeAndAfterAll
6
7
import org .scalatest .FunSuite
7
8
8
9
abstract class SemanticRewriteSuite (
9
10
val mirror : Database ,
10
11
val inputSourceroot : AbsolutePath ,
11
- val expectedOutputSourceroot : AbsolutePath
12
+ val expectedOutputSourceroot : Seq [ AbsolutePath ]
12
13
) extends FunSuite
13
14
with DiffAssertions
14
15
with BeforeAndAfterAll { self =>
@@ -27,7 +28,19 @@ abstract class SemanticRewriteSuite(
27
28
}
28
29
val expected =
29
30
new String (
30
- expectedOutputSourceroot.resolve(diffTest.filename).readAllBytes)
31
+ expectedOutputSourceroot
32
+ .map(_.resolve(diffTest.filename))
33
+ .find(_.isFile)
34
+ .map(_.readAllBytes)
35
+ .getOrElse {
36
+ val tried = expectedOutputSourceroot
37
+ .map(_.resolve(diffTest.filename))
38
+ .mkString(" \n " )
39
+ sys.error(
40
+ s """ Missing expected output file for test ${diffTest.filename}. Tried:
41
+ | $tried""" .stripMargin)
42
+ }
43
+ )
31
44
assertNoDiff(obtained, expected)
32
45
}
33
46
}
File renamed without changes.
Original file line number Diff line number Diff line change @@ -7,7 +7,10 @@ class SemanticTests
7
7
extends SemanticRewriteSuite (
8
8
Database .load(Classpath (AbsolutePath (BuildInfo .mirrorClasspath))),
9
9
AbsolutePath (BuildInfo .inputSourceroot),
10
- AbsolutePath (BuildInfo .outputSourceroot)
10
+ Seq (
11
+ AbsolutePath (BuildInfo .outputSourceroot),
12
+ AbsolutePath (BuildInfo .outputDottySourceroot)
13
+ )
11
14
) {
12
15
runAllTests()
13
16
}
You can’t perform that action at this time.
0 commit comments