Skip to content

Commit b788993

Browse files
Replace absolute paths with relative ones
1 parent 171f4c9 commit b788993

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

compiler/test/dotty/tools/vulpix/ParallelTesting.scala

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
5858
def flags: TestFlags
5959
def sourceFiles: Array[JFile]
6060

61-
def runClassPath: String = outDir.getAbsolutePath + JFile.pathSeparator + flags.runClassPath
61+
def runClassPath: String = outDir.getPath + JFile.pathSeparator + flags.runClassPath
6262

6363
def title: String = self match {
6464
case self: JointCompilationSource =>
@@ -107,7 +107,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
107107

108108
self match {
109109
case source: JointCompilationSource => {
110-
source.sourceFiles.map(_.getAbsolutePath).foreach { path =>
110+
source.sourceFiles.map(_.getPath).foreach { path =>
111111
sb.append(delimiter)
112112
sb.append(path)
113113
sb += ' '
@@ -217,10 +217,10 @@ trait ParallelTesting extends RunnerOrchestration { self =>
217217
*/
218218
final def checkFile(testSource: TestSource): Option[JFile] = (testSource match {
219219
case ts: JointCompilationSource =>
220-
ts.files.collectFirst { case f if !f.isDirectory => new JFile(f.getAbsolutePath.replaceFirst("\\.scala$", ".check")) }
220+
ts.files.collectFirst { case f if !f.isDirectory => new JFile(f.getPath.replaceFirst("\\.scala$", ".check")) }
221221

222222
case ts: SeparateCompilationSource =>
223-
Option(new JFile(ts.dir.getAbsolutePath + ".check"))
223+
Option(new JFile(ts.dir.getPath + ".check"))
224224
}).filter(_.exists)
225225

226226
/**
@@ -319,9 +319,9 @@ trait ParallelTesting extends RunnerOrchestration { self =>
319319
if (!testFilter.isDefined) testSources
320320
else testSources.filter {
321321
case JointCompilationSource(_, files, _, _, _, _) =>
322-
files.exists(file => file.getAbsolutePath.contains(testFilter.get))
322+
files.exists(file => file.getPath.contains(testFilter.get))
323323
case SeparateCompilationSource(_, dir, _, _) =>
324-
dir.getAbsolutePath.contains(testFilter.get)
324+
dir.getPath.contains(testFilter.get)
325325
}
326326

327327
/** Total amount of test sources being compiled by this test */
@@ -424,8 +424,8 @@ trait ParallelTesting extends RunnerOrchestration { self =>
424424

425425
protected def compile(files0: Array[JFile], flags0: TestFlags, suppressErrors: Boolean, targetDir: JFile): TestReporter = {
426426

427-
val flags = flags0.and("-d", targetDir.getAbsolutePath)
428-
.withClasspath(targetDir.getAbsolutePath)
427+
val flags = flags0.and("-d", targetDir.getPath)
428+
.withClasspath(targetDir.getPath)
429429

430430
def flattenFiles(f: JFile): Array[JFile] =
431431
if (f.isDirectory) f.listFiles.flatMap(flattenFiles)
@@ -469,10 +469,10 @@ trait ParallelTesting extends RunnerOrchestration { self =>
469469

470470
// If a test contains a Java file that cannot be parsed by Dotty's Java source parser, its
471471
// name must contain the string "JAVA_ONLY".
472-
val dottyFiles = files.filterNot(_.getName.contains("JAVA_ONLY")).map(_.getAbsolutePath)
472+
val dottyFiles = files.filterNot(_.getName.contains("JAVA_ONLY")).map(_.getPath)
473473
driver.process(allArgs ++ dottyFiles, reporter = reporter)
474474

475-
val javaFiles = files.filter(_.getName.endsWith(".java")).map(_.getAbsolutePath)
475+
val javaFiles = files.filter(_.getName.endsWith(".java")).map(_.getPath)
476476
val javaErrors = compileWithJavac(javaFiles)
477477

478478
if (javaErrors.isDefined) {
@@ -486,7 +486,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
486486
protected def compileFromTasty(flags0: TestFlags, suppressErrors: Boolean, targetDir: JFile): TestReporter = {
487487
val tastyOutput = new JFile(targetDir.getPath + "_from-tasty")
488488
tastyOutput.mkdir()
489-
val flags = flags0 and ("-d", tastyOutput.getAbsolutePath) and "-from-tasty"
489+
val flags = flags0 and ("-d", tastyOutput.getPath) and "-from-tasty"
490490

491491
def tastyFileToClassName(f: JFile): String = {
492492
val pathStr = targetDir.toPath.relativize(f.toPath).toString.replace(JFile.separatorChar, '.')
@@ -668,7 +668,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
668668
Source.fromFile(file, "UTF-8").getLines().zipWithIndex.foreach { case (line, lineNbr) =>
669669
val errors = line.sliding("// error".length).count(_.mkString == "// error")
670670
if (errors > 0)
671-
errorMap.put(s"${file.getAbsolutePath}:${lineNbr}", errors)
671+
errorMap.put(s"${file.getPath}:${lineNbr}", errors)
672672

673673
val noposErrors = line.sliding("// nopos-error".length).count(_.mkString == "// nopos-error")
674674
if (noposErrors > 0) {
@@ -938,7 +938,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
938938
* and if so copying recursively
939939
*/
940940
private def copyToDir(dir: JFile, file: JFile): JFile = {
941-
val target = Paths.get(dir.getAbsolutePath, file.getName)
941+
val target = Paths.get(dir.getPath, file.getName)
942942
Files.copy(file.toPath, target, REPLACE_EXISTING)
943943
if (file.isDirectory) file.listFiles.map(copyToDir(target.toFile, _))
944944
target.toFile
@@ -1216,7 +1216,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
12161216
val (dirs, files) = compilationTargets(sourceDir, fromTastyFilter)
12171217

12181218
val filteredFiles = testFilter match {
1219-
case Some(str) => files.filter(_.getAbsolutePath.contains(str))
1219+
case Some(str) => files.filter(_.getPath.contains(str))
12201220
case None => files
12211221
}
12221222

0 commit comments

Comments
 (0)