Permalink
Browse files

Merge pull request #7 from dotta/topic/fix-test-classpath

Topic/fix test classpath
  • Loading branch information...
2 parents 3190b17 + 0e6fa08 commit 40bbcf51630bc3599a70b21809256cbb3aaa3d8d @jsuereth jsuereth committed May 25, 2012
View
11 project/Build.scala
@@ -58,7 +58,7 @@ object BuildSettings {
</scm>
<developers>
<developer>
- <id>mirco</id>
+ <id>mdotta</id>
<name>Mirco Dotta</name>
</developer>
<developer>
@@ -76,7 +76,7 @@ object Dependencies {
val compiler = "org.scala-lang" % "scala-compiler" % buildScalaVer
val swing = "org.scala-lang" % "scala-swing" % buildScalaVer
- val specs2 = "org.specs2" % "specs2_2.9.1" % "1.5" % "test"
+ val specs2 = "org.specs2" %% "specs2" % "1.5" % "test"
}
object MimaBuild extends Build {
@@ -217,17 +217,20 @@ object MimaBuild extends Build {
val testClass = loader.loadClass("com.typesafe.tools.mima.lib.CollectProblemsTest")
val testRunner = testClass.newInstance().asInstanceOf[
- { def runTest(testName: String, oldJarPath: String, newJarPath: String,
+ { def runTest(testClasspath: List[String], testName: String, oldJarPath: String, newJarPath: String,
oraclePath: String): Unit
}]
+ // Add the scala-library to the MiMa classpath used to run this test
+ val testClasspath = data(cp).filter(_.getName endsWith "scala-library.jar").map(_.getAbsolutePath).toList
+
val projectPath = proj.build.getPath + "reporter" + "/" + "functional-tests" + "/" + "src" +
"/" + "test" + "/" + proj.project
val oraclePath = projectPath + "/problems.txt"
try {
- testRunner.runTest(proj.project, v1.getAbsolutePath, v2.getAbsolutePath, oraclePath)
+ testRunner.runTest(testClasspath, proj.project, v1.getAbsolutePath, v2.getAbsolutePath, oraclePath)
streams.log.info("Test '" + proj.project + "' succeeded.")
} catch {
case e: Exception => streams.log.error(e.toString)
View
4 reporter-ui/build.sbt
@@ -1,3 +1,3 @@
-mainClass in (Compile, packageBin) := Some("ssol.tools.mima.lib.ui.MimaLibApp")
+mainClass in (Compile, packageBin) := Some("com.typesafe.tools.mima.lib.ui.MimaLibApp")
-mainClass in (Compile, sbt.Keys.run) := Some("ssol.tools.mima.lib.ui.MimaLibApp")
+mainClass in (Compile, sbt.Keys.run) := Some("com.typesafe.tools.mima.lib.ui.MimaLibApp")
View
4 reporter/build.sbt
@@ -1,3 +1,3 @@
-mainClass in (Compile, packageBin) := Some("ssol.tools.mima.cli.Main")
+mainClass in (Compile, packageBin) := Some("com.typesafe.tools.mima.cli.Main")
-mainClass in (Compile, sbt.Keys.run) := Some("ssol.tools.mima.cli.Main")
+mainClass in (Compile, sbt.Keys.run) := Some("com.typesafe.tools.mima.cli.Main")
View
5 ...ter/functional-tests/src/main/scala/com/typesafe/tools/mima/lib/CollectProblemsTest.scala
@@ -8,11 +8,10 @@ case class TestFailed(msg: String) extends Exception(msg)
class CollectProblemsTest {
- def runTest(testName: String, oldJarPath: String, newJarPath: String, oraclePath: String) {
+ def runTest(testClasspath: List[String])(testName: String, oldJarPath: String, newJarPath: String, oraclePath: String) {
// load test setup
Config.setup("scala com.typesafe.tools.mima.MiMaLibUI <old-dir> <new-dir>", Array(oldJarPath, newJarPath))
- var scalaLib = "regressions-tests/scala-library/scala-library-2.9.0.jar"
- val cp = scalaLib :: ClassPath.split(Config.baseClassPath.asClasspathString)
+ val cp = testClasspath ::: ClassPath.split(Config.baseClassPath.asClasspathString)
val cpString = ClassPath.join(cp: _*)
Config.baseClassPath = new JavaClassPath(ClassPath.DefaultJavaContext.classesInPath(cpString).toIndexedSeq, ClassPath.DefaultJavaContext)

0 comments on commit 40bbcf5

Please sign in to comment.