Skip to content

Make JUnit tests runnable from the command line #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,24 @@ name := "dotty"

organization := "lamp"

scalaVersion := "2.10.0"
scalaVersion := "2.11.0-M6"

scalaBinaryVersion := scalaVersion.value

scalaSource in Compile <<= baseDirectory / "src"

scalacOptions in Global ++= Seq("-feature", "-deprecation", "-language:_")

libraryDependencies <+= scalaVersion ( sv => "org.scala-lang" % "scala-reflect" % sv )
libraryDependencies ++= Seq(
"org.scala-lang" % "scala-reflect" % scalaVersion.value,
"org.scala-lang.modules" %% "scala-xml" % "1.0.0-RC6"
)

scalaSource in Test <<= baseDirectory / "test"

libraryDependencies += "junit" % "junit-dep" % "4.10" % "test"

libraryDependencies += "com.novocode" % "junit-interface" % "0.10" % "test"

testOptions += Tests.Argument(TestFrameworks.JUnit, "-q", "-v", "-s")

scalaSource in Test <<= baseDirectory / "test"
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=0.12.2
sbt.version=0.13.0
14 changes: 12 additions & 2 deletions src/dotty/tools/dotc/config/PathResolver.scala
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,23 @@ object PathResolver {
def classPathEnv = envOrElse("CLASSPATH", "")
def sourcePathEnv = envOrElse("SOURCEPATH", "")

def javaBootClassPath = propOrElse("sun.boot.class.path", searchForBootClasspath)
// See https://gist.github.com/harrah/404272
private def getEmbeddedClasspath(id: String): String =
Option(getClass.getClassLoader.getResource(s"$id.class.path")) map { cp => scala.io.Source.fromURL(cp).mkString(File.pathSeparator) }

def javaBootClassPath = {
val jvmBoot = propOrElse("sun.boot.class.path", searchForBootClasspath)
getEmbeddedClasspath("boot") match {
case Some(embeddedBoot) => jvmBoot + File.pathSeparator + embeddedBoot
case None => jvmBoot
}
}
def javaExtDirs = propOrEmpty("java.ext.dirs")
def scalaHome = propOrEmpty("scala.home")
def scalaExtDirs = propOrEmpty("scala.ext.dirs")

/** The java classpath and whether to use it. */
def javaUserClassPath = propOrElse("java.class.path", "")
def javaUserClassPath = getEmbeddedClasspath("app").getOrElse(propOrElse("java.class.path", ""))
def useJavaClassPath = propOrFalse("scala.usejavacp")

override def toString = """
Expand Down
1 change: 1 addition & 0 deletions test/test/DottyTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class DottyTest {
.withSetting(printtypes, true)
.withSetting(pageWidth, 90)
.withSetting(log, List("<some"))
.withSetting(usejavacp, true)
// .withTyperState(new TyperState(new ConsoleReporter()(base.initialCtx)))

// .withSetting(uniqid, true)
Expand Down