File tree Expand file tree Collapse file tree 3 files changed +27
-1
lines changed Expand file tree Collapse file tree 3 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -17,5 +17,21 @@ libraryDependencies += "junit" % "junit" % "4.11" % "test"
1717
1818libraryDependencies += " com.novocode" % " junit-interface" % " 0.10" % " test"
1919
20+ // // testing:
2021// used in CompilerErrors test
21- libraryDependencies += " org.scala-lang" % " scala-compiler" % scalaVersion.value % " test"
22+ libraryDependencies += (" org.scala-lang" % " scala-compiler" % scalaVersion.value % " test" ).exclude(" org.scala-lang.modules" , s " scala-xml* " )
23+
24+ // needed to fix classloader issues (see #20)
25+ // alternatively, manage the scala instance as shown below (commented)
26+ fork in Test := true
27+
28+ // ALTERNATIVE: manage the Scala instance ourselves to exclude the published scala-xml (scala-compiler depends on it)
29+ // since this dependency hides the classes we're testing
30+ // managedScalaInstance := false
31+ //
32+ // ivyConfigurations += Configurations.ScalaTool
33+ //
34+ // libraryDependencies ++= Seq(
35+ // "org.scala-lang" % "scala-library" % scalaVersion.value,
36+ // ("org.scala-lang" % "scala-compiler" % scalaVersion.value % "scala-tool").exclude("org.scala-lang.modules", s"scala-xml_${scalaBinaryVersion.value}")
37+ // )
Original file line number Diff line number Diff line change @@ -112,3 +112,8 @@ object XML extends XMLLoader[Elem] {
112112 w.write(Utility .serialize(node, minimizeTags = minimizeTags).toString)
113113 }
114114}
115+
116+ object Properties extends scala.util.PropertiesTrait {
117+ protected def propCategory = " scala-xml"
118+ protected def pickJarBasedOn = classOf [scala.xml.pull.XMLEventReader ]
119+ }
Original file line number Diff line number Diff line change @@ -164,6 +164,11 @@ class CompilerErrors extends CompilerTesting {
164164
165165// TODO: factor out somewhere?
166166class CompilerTesting {
167+ // TODO: refine this; for now, just println -- the goal is to ensure we're testing the right version of scala-xml
168+ // (it should print the same thing as the version in the sbt build)
169+ // we used to always test the scala-xml jar that the compiler depends on, because it was part of the scala-tool ivy config
170+ println(s " Testing scala-xml version ${Properties .versionNumberString}. " )
171+
167172 def errorMessages (errorSnippet : String , compileOptions : String = " " )(code : String ): List [String ] = {
168173 import scala .tools .reflect ._
169174 val m = scala.reflect.runtime.currentMirror
You can’t perform that action at this time.
0 commit comments