diff options
author | Paul Phillips <paulp@improving.org> | 2010-09-14 04:48:30 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2010-09-14 04:48:30 +0000 |
commit | c40a798bf0b9ebe26385d42dbd90edc61ca0896d (patch) | |
tree | 746508b3b4ae7f25a0d59d17cf8ccd55bad05b68 /src | |
parent | 964cceed6db7b028d694521d251f236ca0c0ccb5 (diff) | |
download | scala-c40a798bf0b9ebe26385d42dbd90edc61ca0896d.tar.gz scala-c40a798bf0b9ebe26385d42dbd90edc61ca0896d.tar.bz2 scala-c40a798bf0b9ebe26385d42dbd90edc61ca0896d.zip |
Couldn't bear to see sbt seemingly so close but...
Couldn't bear to see sbt seemingly so close but still unable to run
tests. Made some progress but bogged down in scalacheck when I realized
things were farther from working than I'd thought. Please forgive this
brief expression of frustration, because the despair is palpable:
the weeks of work I did on partest was apparently of no interest,
and now I'm in here having to fix the same partest bugs again, in a
more virulent form. They've evolved into some kind of ant-partest-sbt
artificial creature, more fearsome than any one of them could be under
its own power.
Did we not know we have a whole directory full of pretty code like this?
List(
"Scala compiler classes in: " + testBuildDir,
"Scala version is: " + nsc.Properties.versionMsg,
"Scalac options are: " + universe.scalacOpts,
"Java binaries in: " + javaBin,
"Java runtime is: " + javaInfoString,
"Java runtime options: " + (Process.javaVmArguments mkString " "),
"Javac options are: " + universe.javacOpts,
"Java options are: " + universe.javaOpts,
"Source directory is: " + src,
"Selected categories: " + (selectedCategories mkString " "),
""
) mkString "\n"
It's src/partest-alternative in case anyone wants to consider any of it.
At the very least there are individual files or functions which could be
cherry picked.
-- This patch contains: --
Readability efforts. Twelve parameter functions whose last six
parameters are "true,true,failedOnly,true,false,log" are pretty
challenging to work with.
Changes to the environment variables sbt was setting to look a bit more
like what partest expects and will crash without.
Sets partest.debug=true if the sbt logger level is at Debug.
On my machine all test groups except scalacheck appear to run to
completion.
Review by moix. (Hello, moix! I am available for assistance if you are
in the market for it. You have brought us long suffering ant-ers to the
brink of sbt goodness: and now, we enter the fray!)
Diffstat (limited to 'src')
-rw-r--r-- | src/partest/scala/tools/partest/nest/PathSettings.scala | 15 | ||||
-rw-r--r-- | src/partest/scala/tools/partest/nest/SBTRunner.scala | 12 | ||||
-rw-r--r-- | src/partest/scala/tools/partest/nest/Worker.scala | 2 |
3 files changed, 17 insertions, 12 deletions
diff --git a/src/partest/scala/tools/partest/nest/PathSettings.scala b/src/partest/scala/tools/partest/nest/PathSettings.scala index fd8eb4cdfa..5ae1ed05ce 100644 --- a/src/partest/scala/tools/partest/nest/PathSettings.scala +++ b/src/partest/scala/tools/partest/nest/PathSettings.scala @@ -32,17 +32,22 @@ object PathSettings { lazy val srcLibDir = Directory(srcDir / "lib") // Directory <root>/build - lazy val buildDir = Directory("build") + lazy val buildDir: Directory = { + val bases = testRoot :: testRoot.parents + // In the classic "ant" build, the relevant subdirectory is called build, + // but in the postmodern "sbt" build, it is called target. Look for both. + val dirs = Path.onlyDirs(bases flatMap (x => List(x / "build", x / "target"))) + + dirs.headOption getOrElse error("Neither 'build' nor 'target' dir found under test root " + testRoot + ".") + } // Directory <root>/build/pack/lib lazy val buildPackLibDir = Directory(buildDir / "pack" / "lib") - lazy val scalaCheck = { - (buildPackLibDir.files find (_.name startsWith "scalacheck")) orElse - (srcLibDir.files find (_.name startsWith "scalacheck")) getOrElse { + lazy val scalaCheck: File = + buildPackLibDir.files ++ srcLibDir.files find (_.name startsWith "scalacheck") getOrElse { error("No scalacheck jar found in '%s' or '%s'".format(buildPackLibDir, srcLibDir)) } - } } class PathSettings() { diff --git a/src/partest/scala/tools/partest/nest/SBTRunner.scala b/src/partest/scala/tools/partest/nest/SBTRunner.scala index 6a908af1bf..299296b01d 100644 --- a/src/partest/scala/tools/partest/nest/SBTRunner.scala +++ b/src/partest/scala/tools/partest/nest/SBTRunner.scala @@ -8,12 +8,12 @@ import scala.tools.nsc.io.{ Directory } class SBTRunner extends DirectRunner { val fileManager = new FileManager { - var JAVACMD: String = "java" - var JAVAC_CMD: String = "javac" - var CLASSPATH: String = _ - var LATEST_LIB: String = _ - val testRootPath: String = "test" - val testRootDir: Directory = Directory(testRootPath) + var JAVACMD: String = "java" + var JAVAC_CMD: String = "javac" + var CLASSPATH: String = _ + var LATEST_LIB: String = _ + val testRootPath: String = PathSettings.testRoot.path + val testRootDir: Directory = PathSettings.testRoot } def reflectiveRunTestsForFiles(kindFiles: Array[File], kind: String):java.util.HashMap[String,Int] = { diff --git a/src/partest/scala/tools/partest/nest/Worker.scala b/src/partest/scala/tools/partest/nest/Worker.scala index 623a7a9674..c719dc9709 100644 --- a/src/partest/scala/tools/partest/nest/Worker.scala +++ b/src/partest/scala/tools/partest/nest/Worker.scala @@ -50,7 +50,7 @@ class ScalaCheckFileManager(val origmanager: FileManager) extends FileManager { var JAVACMD: String = origmanager.JAVACMD var JAVAC_CMD: String = origmanager.JAVAC_CMD - var CLASSPATH: String = origmanager.CLASSPATH + java.io.File.pathSeparator + PathSettings.scalaCheck + var CLASSPATH: String = join(origmanager.CLASSPATH, PathSettings.scalaCheck.path) var LATEST_LIB: String = origmanager.LATEST_LIB } |