Skip to content
This repository was archived by the owner on Sep 8, 2022. It is now read-only.

Commit b08c6ea

Browse files
committed
Store partest version and show it (1.0-RC1)
1 parent eaad2ea commit b08c6ea

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

build.sbt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ organization := "org.scala-lang"
77

88
name := "scala-partest"
99

10-
version := "1.0"
10+
version := "1.0-RC1"
1111

1212
scalaBinaryVersion := "2.11.0-M4"
1313

@@ -27,3 +27,14 @@ libraryDependencies += "org.scalacheck" %% "scalacheck" % "1.
2727

2828
libraryDependencies += "org.scala-sbt" % "test-interface" % "1.0"
2929

30+
resourceGenerators in Compile <+= Def.task {
31+
val props = new java.util.Properties
32+
props.put("version.number", version.value)
33+
val file = (resourceManaged in Compile).value / "partest.properties"
34+
IO.write(props, null, file)
35+
Seq(file)
36+
}
37+
38+
mappings in (Compile, packageBin) += {
39+
(baseDirectory.value / "partest.properties") -> "partest.properties"
40+
}

src/main/scala/scala/tools/partest/nest/Runner.scala

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,6 +721,12 @@ class Runner(val testFile: File, val suiteRunner: SuiteRunner) {
721721

722722
}
723723

724+
/** Loads `library.properties` from the jar. */
725+
object Properties extends scala.util.PropertiesTrait {
726+
protected def propCategory = "partest"
727+
protected def pickJarBasedOn = classOf[SuiteRunner]
728+
}
729+
724730
/** Extended by Ant- and ConsoleRunner for running a set of tests. */
725731
class SuiteRunner(
726732
val testSourcePath: String,
@@ -744,7 +750,8 @@ class SuiteRunner(
744750
val vmBin = javaHome + fileSeparator + "bin"
745751
val vmName = "%s (build %s, %s)".format(javaVmName, javaVmVersion, javaVmInfo)
746752

747-
s"""|Compiler under test: ${relativize(fileManager.compilerUnderTest.getAbsolutePath)}
753+
s"""|Partest version: ${Properties.versionNumberString}
754+
|Compiler under test: ${relativize(fileManager.compilerUnderTest.getAbsolutePath)}
748755
|Scala version is: $versionMsg
749756
|Scalac options are: ${scalacExtraArgs.mkString(" ")}
750757
|Compilation Path: ${relativize(joinPaths(fileManager.testClassPath))}

0 commit comments

Comments
 (0)