summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormichelou <michelou@epfl.ch>2009-03-10 17:39:26 +0000
committermichelou <michelou@epfl.ch>2009-03-10 17:39:26 +0000
commitec04bfb454f19676c77325cb8a5e16e21cb1b1de (patch)
tree59e2a53aedb9f619e06d67e31d63c7b053066ddc
parent807daab252714f28d0d7a0e172af682520a8cf16 (diff)
downloadscala-ec04bfb454f19676c77325cb8a5e16e21cb1b1de.tar.gz
scala-ec04bfb454f19676c77325cb8a5e16e21cb1b1de.tar.bz2
scala-ec04bfb454f19676c77325cb8a5e16e21cb1b1de.zip
added partest.properties to jar
-rw-r--r--build.xml9
-rw-r--r--src/partest/scala/tools/partest/nest/ConsoleRunner.scala2
-rw-r--r--src/partest/scala/tools/partest/nest/NestUI.scala5
-rw-r--r--src/partest/scala/tools/partest/nest/StreamAppender.scala21
-rw-r--r--src/partest/scala/tools/partest/utils/Properties.scala1
5 files changed, 20 insertions, 18 deletions
diff --git a/build.xml b/build.xml
index 9dd841fde8..b72239284c 100644
--- a/build.xml
+++ b/build.xml
@@ -131,9 +131,10 @@ PROPERTIES
<property name="build-docs.dir" value="${build.dir}/scaladoc"/>
<property name="dists.dir" value="${basedir}/dists"/>
-
+
<property name="copyright.string" value="Copyright 2002-2009, LAMP/EPFL"/>
-
+ <property name="partest.version.number" value="0.9.2"/>
+
<!-- These are NOT the flags used to run SuperSabbus, but the ones written
into the script runners created with scala.tools.ant.ScalaTool -->
<property name="java.flags" value="-Xmx256M -Xms32M"/>
@@ -508,6 +509,10 @@ QUICK BUILD (QUICK)
<pathelement location="${ant.jar}"/>
</compilationpath>
</scalacfork>
+ <propertyfile file="${build-quick.dir}/classes/partest/partest.properties">
+ <entry key="version.number" value="${partest.version.number}"/>
+ <entry key="copyright.string" value="${copyright.string}"/>
+ </propertyfile>
<copy todir="${build-quick.dir}/classes/partest">
<fileset dir="${src.dir}/partest">
<include name="**/*.xml"/>
diff --git a/src/partest/scala/tools/partest/nest/ConsoleRunner.scala b/src/partest/scala/tools/partest/nest/ConsoleRunner.scala
index f85f16efec..065d04f332 100644
--- a/src/partest/scala/tools/partest/nest/ConsoleRunner.scala
+++ b/src/partest/scala/tools/partest/nest/ConsoleRunner.scala
@@ -56,7 +56,7 @@ class ConsoleRunner extends DirectRunner with RunnerUtils {
private def printVersion {
val versionMsg = "Scala partest "+
- NestUI.versionString+
+ utils.Properties.versionString+
" -- "+
scala.tools.nsc.Properties.copyrightString
NestUI.outline(versionMsg+"\n")
diff --git a/src/partest/scala/tools/partest/nest/NestUI.scala b/src/partest/scala/tools/partest/nest/NestUI.scala
index 4dcebf8a41..b6a8ec0253 100644
--- a/src/partest/scala/tools/partest/nest/NestUI.scala
+++ b/src/partest/scala/tools/partest/nest/NestUI.scala
@@ -11,9 +11,6 @@ import java.io.PrintWriter
object NestUI {
- val versionString =
- System.getProperty("partest.version", "version 0.9.2")
-
val NONE = 0
val SOME = 1
val MANY = 2
@@ -95,7 +92,7 @@ object NestUI {
println(" --srcpath set (relative) path to test source files")
println(" ex.: --srcpath pending")
println
- println(versionString)
+ println(utils.Properties.versionString)
println("maintained by Philipp Haller (EPFL)")
exit(1)
}
diff --git a/src/partest/scala/tools/partest/nest/StreamAppender.scala b/src/partest/scala/tools/partest/nest/StreamAppender.scala
index 140934990b..4ae7cbda27 100644
--- a/src/partest/scala/tools/partest/nest/StreamAppender.scala
+++ b/src/partest/scala/tools/partest/nest/StreamAppender.scala
@@ -12,16 +12,14 @@ import java.io.{Writer, PrintWriter, Reader, BufferedReader,
OutputStreamWriter, StringReader, OutputStream}
object StreamAppender {
- def apply(reader: BufferedReader, writer: Writer) = {
+
+ def apply(reader: BufferedReader, writer: Writer): StreamAppender = {
val pwriter = new PrintWriter(writer, true)
new StreamAppender(reader, pwriter)
}
- def apply(reader: Reader, writer: Writer) = {
- val bufReader = new BufferedReader(reader)
- val pwriter = new PrintWriter(writer, true)
- new StreamAppender(bufReader, pwriter)
- }
+ def apply(reader: Reader, writer: Writer): StreamAppender =
+ apply(new BufferedReader(reader), writer)
def appendToString(in1: InputStream, in2: InputStream): String = {
val swriter1 = new StringWriter
@@ -37,8 +35,8 @@ object StreamAppender {
async.join()
swriter1.toString + swriter2.toString
}
-
- def inParallel(t1: Runnable, t2: Runnable, t3: Runnable) {
+/*
+ private def inParallel(t1: Runnable, t2: Runnable, t3: Runnable) {
val thr1 = new Thread(t1)
val thr2 = new Thread(t2)
thr1.start()
@@ -47,8 +45,8 @@ object StreamAppender {
thr1.join()
thr2.join()
}
-
- def inParallel(t1: Runnable, t2: Runnable) {
+*/
+ private def inParallel(t1: Runnable, t2: Runnable) {
val thr = new Thread(t2)
thr.start()
t1.run()
@@ -75,7 +73,8 @@ object StreamAppender {
class StreamAppender(reader: BufferedReader, writer: PrintWriter) extends Runnable {
override def run() = runAndMap(identity)
- def runAndMap(f:String=>String): Unit = {
+
+ def runAndMap(f: String => String) {
try {
var line = reader.readLine()
while (line != null) {
diff --git a/src/partest/scala/tools/partest/utils/Properties.scala b/src/partest/scala/tools/partest/utils/Properties.scala
index 1807c26cf2..d75791c0e7 100644
--- a/src/partest/scala/tools/partest/utils/Properties.scala
+++ b/src/partest/scala/tools/partest/utils/Properties.scala
@@ -9,6 +9,7 @@
// $Id$
package scala.tools.partest.utils
+
import scala.util.PropertiesTrait
/** A utility to load the library properties from a Java properties file