scala/scala-partest — pull request #6 by retronym (2013-10-21 12:04:46+00:00)
Title: Fix --srcpath command line option

The path was prematurely expanded to an absoulte path; later
it was treated as a relative path to "test".

A workaround is to use:

% JAVA_OPTS=-Dpartest.srcdir=disabled test/partest test/disabled/neg/t7020.scala

baseDir: /Users/jason/code/scala/build/pack/lib
sourceDir: /Users/jason/code/scala/test/disabled

Selected 1 tests drawn from specified tests

starting 1 test in neg
ok 1 - neg/t7020.scala

1/1 passed (elapsed time: 00:00:04)
Test Run PASSED

Which avoids the failure:

test/partest --srcpath disabled disabled/neg/t7020.scala Discarding 1 invalid test paths
Uncaught exception on thread Thread[main,5,main]: java.lang.RuntimeException: Directory 'test' not found.
java.lang.RuntimeException: Directory 'test' not found.

I tested this commit with:

% (cd /code/scala-partest && sbt 'set publishTo := Some(Resolver.file("file", new File(Path.userHome.absolutePath+"/.m2/repository")))' publish)
...
[info] published scala-partest_2.11.0-M5 to /Users/jason/.m2/repository/org/scala-lang/modules/scala-partest_2.11.0-M5/1.0.0-SNAPSHOT/scala-partest_2.11.0-M5-1.0.0-SNAPSHOT.jar

% git diff versions.properties
diff --git a/versions.properties b/versions.properties
index 865ce3e..0dd4369 100644
--- a/versions.properties
+++ b/versions.properties
@@ -2,6 +2,6 @@ starr.version=2.11.0-M5

# the below is used for depending on dependencies like partest
scala.binary.version=2.11.0-M5
-partest.version.number=1.0-RC5
+partest.version.number=1.0.0-SNAPSHOT
scala-xml.version.number=1.0-RC4
scala-parser-combinators.version.number=1.0-RC2

% rm build/pack/partest.properties

% test/partest --srcpath disabled test/disabled/neg/t7020.scala
...
sourceDir: /Users/jason/code/scala/test/disabled

Selected 1 tests drawn from specified tests

# starting 1 test in neg
ok 1 - neg/t7020.scala

1/1 passed (elapsed time: 00:00:04)
Test Run PASSED