Skip to content

Commit bbd9aeb

Browse files
committed
Avoid NPE in ParallelTesting on junk files
Emacs often produces temporary files in directories. These used to cause NPEs in the new testing framework. We now fix this by only compiling file names that designate source files.
1 parent f370799 commit bbd9aeb

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -920,9 +920,8 @@ trait ParallelTesting { self =>
920920
private def compilationTargets(sourceDir: JFile): (List[JFile], List[JFile]) =
921921
sourceDir.listFiles.foldLeft((List.empty[JFile], List.empty[JFile])) { case ((dirs, files), f) =>
922922
if (f.isDirectory) (f :: dirs, files)
923-
else if (f.getName.endsWith(".check")) (dirs, files)
924-
else if (f.getName.endsWith(".flags")) (dirs, files)
925-
else (dirs, f :: files)
923+
else if (isSourceFile(f)) (dirs, f :: files)
924+
else (dirs, files)
926925
}
927926

928927
/** Gets the name of the calling method via reflection.

0 commit comments

Comments
 (0)