Skip to content

Commit 0451816

Browse files
committed
Make tests support .hasTasty and .tasty files
1 parent 770d15c commit 0451816

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -404,9 +404,11 @@ trait ParallelTesting extends RunnerOrchestration { self =>
404404
tastyOutput.mkdir()
405405
val flags = flags0 and ("-d", tastyOutput.getAbsolutePath) and "-from-tasty"
406406

407-
def hasTastyFileToClassName(f: JFile): String =
408-
targetDir.toPath.relativize(f.toPath).toString.dropRight(".hasTasty".length).replace('/', '.')
409-
val classes = flattenFiles(targetDir).filter(isHasTastyFile).map(hasTastyFileToClassName)
407+
def tastyFileToClassName(f: JFile): String = {
408+
val pathStr = targetDir.toPath.relativize(f.toPath).toString.replace('/', '.')
409+
pathStr.stripSuffix(".tasty").stripSuffix(".hasTasty")
410+
}
411+
val classes = flattenFiles(targetDir).filter(isHasTastyFile).map(tastyFileToClassName)
410412

411413
val reporter =
412414
TestReporter.reporter(realStdout, logLevel =
@@ -434,7 +436,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
434436
"-decompile" and "-pagewidth" and "80"
435437

436438
def hasTastyFileToClassName(f: JFile): String =
437-
targetDir0.toPath.relativize(f.toPath).toString.dropRight(".hasTasty".length).replace('/', '.')
439+
targetDir0.toPath.relativize(f.toPath).toString.stripSuffix(".hasTasty").stripSuffix(".tasty").replace('/', '.')
438440
val classes = flattenFiles(targetDir0).filter(isHasTastyFile).map(hasTastyFileToClassName).sorted
439441

440442
val reporter =
@@ -1362,5 +1364,5 @@ object ParallelTesting {
13621364
}
13631365

13641366
def isHasTastyFile(f: JFile): Boolean =
1365-
f.getName.endsWith(".hasTasty")
1367+
f.getName.endsWith(".hasTasty") || f.getName.endsWith(".tasty")
13661368
}

0 commit comments

Comments
 (0)