summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/partest/scala/tools/partest/DirectTest.scala4
-rw-r--r--src/partest/scala/tools/partest/IcodeTest.scala6
2 files changed, 7 insertions, 3 deletions
diff --git a/src/partest/scala/tools/partest/DirectTest.scala b/src/partest/scala/tools/partest/DirectTest.scala
index 95a8ae57dd..e6e817f96d 100644
--- a/src/partest/scala/tools/partest/DirectTest.scala
+++ b/src/partest/scala/tools/partest/DirectTest.scala
@@ -19,6 +19,10 @@ abstract class DirectTest extends App {
// produce the output to be compared against a checkfile
def show(): Unit
+ // the test file or dir, and output directory
+ def testPath = io.File(sys.props("partest.test-path"))
+ def testOutput = io.Directory(sys.props("partest.output"))
+
// override to add additional settings with strings
def extraSettings: String = ""
// a default Settings object
diff --git a/src/partest/scala/tools/partest/IcodeTest.scala b/src/partest/scala/tools/partest/IcodeTest.scala
index 5a8ec2890f..28891f9bbf 100644
--- a/src/partest/scala/tools/partest/IcodeTest.scala
+++ b/src/partest/scala/tools/partest/IcodeTest.scala
@@ -21,14 +21,14 @@ abstract class IcodeTest extends DirectTest {
// override to check icode at a different point.
def printIcodeAfterPhase = "icode"
// override to use source code other than the file being tested.
- def code = io.File(sys.props("partest.test-path")).slurp()
+ def code = testPath.slurp()
override def extraSettings: String = "-usejavacp -Xprint-icode:" + printIcodeAfterPhase
// Compile, read in all the *.icode files, delete them, and return their contents
def collectIcode(args: String*): List[String] = {
- compile(args: _*)
- val icodeFiles = Directory(".").files.toList filter (_ hasExtension "icode")
+ compile("-d" :: testOutput.path :: args.toList : _*)
+ val icodeFiles = testOutput.files.toList filter (_ hasExtension "icode")
try icodeFiles sortBy (_.name) flatMap (f => f.lines.toList)
finally icodeFiles foreach (f => f.delete())