diff options
author | Paul Phillips <paulp@improving.org> | 2011-08-25 20:55:00 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-08-25 20:55:00 +0000 |
commit | febf1a0cd942f2d222e1d1349eb9551ef36f4f48 (patch) | |
tree | b6a87c9ec820c952935a9fddec2e4dbd722f72bc /src/partest | |
parent | fbb5b57d65d9c786ef618c92165ca1e3a72863ce (diff) | |
download | scala-febf1a0cd942f2d222e1d1349eb9551ef36f4f48.tar.gz scala-febf1a0cd942f2d222e1d1349eb9551ef36f4f48.tar.bz2 scala-febf1a0cd942f2d222e1d1349eb9551ef36f4f48.zip |
Recent icode checking tests were leaving a bit ...
Recent icode checking tests were leaving a bit of a mess in the
filesystem. Taught them to clean up after themselves. I knew I'd pick up
a few useful tricks from my kids. No review.
Diffstat (limited to 'src/partest')
-rw-r--r-- | src/partest/scala/tools/partest/DirectTest.scala | 4 | ||||
-rw-r--r-- | src/partest/scala/tools/partest/IcodeTest.scala | 6 |
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()) |