Skip to content

Commit c067a9c

Browse files
author
extempore
committed
Fixed a path issue in partest, no review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25214 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
1 parent edadcf4 commit c067a9c

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

src/partest/scala/tools/partest/nest/ConsoleFileManager.scala

+4-4
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class ConsoleFileManager extends FileManager {
6565
}
6666

6767
CLASSPATH = {
68-
val libs = (srcDir / Directory("lib")).files filter (_ hasExtension "jar") map (_.normalize.path)
68+
val libs = (srcDir / Directory("lib")).files filter (_ hasExtension "jar") map (_.toCanonical.path)
6969

7070
// add all jars in libs
7171
(CLASSPATH :: libs.toList) mkString pathSeparator
@@ -74,11 +74,11 @@ class ConsoleFileManager extends FileManager {
7474
def findLatest() {
7575
NestUI.verbose("test parent: "+testParent)
7676

77-
def prefixFileWith(parent: File, relPath: String) = (io.File(parent) / relPath).normalize
78-
def prefixFile(relPath: String) = (testParent / relPath).normalize
77+
def prefixFileWith(parent: File, relPath: String) = (io.File(parent) / relPath).toCanonical
78+
def prefixFile(relPath: String) = (testParent / relPath).toCanonical
7979

8080
if (!testClasses.isEmpty) {
81-
testClassesDir = Path(testClasses.get).normalize.toDirectory
81+
testClassesDir = Path(testClasses.get).toCanonical.toDirectory
8282
NestUI.verbose("Running with classes in "+testClassesDir)
8383

8484
latestFile = testClassesDir.parent / "bin"

src/partest/scala/tools/partest/nest/ConsoleRunner.scala

+5-2
Original file line numberDiff line numberDiff line change
@@ -211,10 +211,13 @@ class ConsoleRunner extends DirectRunner {
211211
* @return (success count, failure count)
212212
*/
213213
def testCheckAll(enabledSets: List[TestSet]): (Int, Int) = {
214-
def kindOf(f: File) = (srcDir relativize Path(f).normalize).segments.head
214+
def kindOf(f: File) = (srcDir relativize Path(f).toCanonical).segments.head
215215

216216
val (valid, invalid) = testFiles partition (x => testSetKinds contains kindOf(x))
217-
invalid foreach (x => NestUI.failure("Invalid test file '%s', skipping.\n" format x))
217+
invalid foreach (x => NestUI.failure(
218+
"Invalid test file '%s', skipping.\n".format(x) +
219+
"(Test kind '%s' not in known set '%s')".format(kindOf(x), testSetKinds))
220+
)
218221

219222
val grouped = (valid groupBy kindOf).toList sortBy (x => testSetKinds indexOf x._1)
220223
val runTestsFileLists =

src/partest/scala/tools/partest/nest/PathSettings.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ object PathSettings {
2525
}
2626

2727
// Directory <root>/test/files
28-
lazy val srcDir = Directory(testRoot / srcDirName normalize)
28+
lazy val srcDir = Directory(testRoot / srcDirName toCanonical)
2929

3030
// Directory <root>/test/files/lib
3131
lazy val srcLibDir = Directory(srcDir / "lib")

0 commit comments

Comments
 (0)