Skip to content

Commit 4a9955c

Browse files
committed
Merge pull request #11 from retronym/topic/sbt-junit
Add Junit interface plugin to support 'sbt test'
2 parents 1e20c21 + b42f1b4 commit 4a9955c

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

build.sbt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ val scalaParserCombinatorsDep = "org.scala-lang.modules" %% "scala-parser-combin
5757
val scalaXmlDep = "org.scala-lang.modules" %% "scala-xml" % versionNumber("scala-xml") exclude("org.scala-lang", "scala-library")
5858
val partestDep = "org.scala-lang.modules" %% "scala-partest" % versionNumber("partest") exclude("org.scala-lang", "scala-library")
5959
val junitDep = "junit" % "junit" % "4.11"
60+
val junitIntefaceDep = "com.novocode" % "junit-interface" % "0.11" % "test"
6061
val jlineDep = "jline" % "jline" % versionProps("jline.version")
6162
val antDep = "org.apache.ant" % "ant" % "1.9.4"
6263

@@ -223,7 +224,9 @@ lazy val junit = project.in(file("test") / "junit")
223224
.settings(
224225
scalaVersion := bootstrapScalaVersion,
225226
ivyScala := ivyScala.value map { _.copy(overrideScalaVersion = true) },
226-
libraryDependencies += junitDep,
227+
fork in Test := true,
228+
libraryDependencies ++= Seq(junitDep, junitIntefaceDep),
229+
testOptions += Tests.Argument(TestFrameworks.JUnit, "-a", "-v"),
227230
unmanagedSourceDirectories in Test := List(baseDirectory.value)
228231
)
229232

test/junit/scala/collection/mutable/VectorTest.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ class VectorTest {
3838
def iteratorCat() {
3939
def its = vecs.map(_.toList.toIterator)
4040
val cats = vecs.map(a => its.map(a ++ _))
41-
println(cats)
4241
assert( cats == ans )
4342
}
4443

test/junit/scala/tools/nsc/backend/jvm/CodeGenTools.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import scala.tools.asm.Opcodes
88
import scala.tools.asm.tree.{AbstractInsnNode, LabelNode, ClassNode, MethodNode}
99
import scala.tools.cmd.CommandLineParser
1010
import scala.tools.nsc.backend.jvm.opt.LocalOpt
11+
import scala.tools.nsc.reporters.StoreReporter
1112
import scala.tools.nsc.settings.{MutableSettings, ScalaSettings}
1213
import scala.tools.nsc.{Settings, Global}
1314
import scala.tools.partest.ASMConverters
@@ -43,7 +44,7 @@ object CodeGenTools {
4344
val settings = new Settings()
4445
val args = (CommandLineParser tokenize defaultArgs) ++ (CommandLineParser tokenize extraArgs)
4546
settings.processArguments(args, processAll = true)
46-
val compiler = new Global(settings)
47+
val compiler = new Global(settings, new StoreReporter)
4748
resetOutput(compiler)
4849
compiler
4950
}

0 commit comments

Comments
 (0)