diff options
author | Martin Odersky <odersky@gmail.com> | 2017-03-31 12:03:26 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2017-03-31 13:02:12 +0200 |
commit | bbd9aeb68b8e1690c24a598c55fc7c1acc89b71f (patch) | |
tree | b2e2a4139515abd97e0c242fee273ed249ce580c /compiler/test/dotty/tools/dotc/ParallelTesting.scala | |
parent | f3707992ee2ed56ce754df8c0760fc3928f0317f (diff) | |
download | dotty-bbd9aeb68b8e1690c24a598c55fc7c1acc89b71f.tar.gz dotty-bbd9aeb68b8e1690c24a598c55fc7c1acc89b71f.tar.bz2 dotty-bbd9aeb68b8e1690c24a598c55fc7c1acc89b71f.zip |
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.
Diffstat (limited to 'compiler/test/dotty/tools/dotc/ParallelTesting.scala')
-rw-r--r-- | compiler/test/dotty/tools/dotc/ParallelTesting.scala | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler/test/dotty/tools/dotc/ParallelTesting.scala b/compiler/test/dotty/tools/dotc/ParallelTesting.scala index 289351d81..a81eb4d3a 100644 --- a/compiler/test/dotty/tools/dotc/ParallelTesting.scala +++ b/compiler/test/dotty/tools/dotc/ParallelTesting.scala @@ -920,9 +920,8 @@ trait ParallelTesting { self => private def compilationTargets(sourceDir: JFile): (List[JFile], List[JFile]) = sourceDir.listFiles.foldLeft((List.empty[JFile], List.empty[JFile])) { case ((dirs, files), f) => if (f.isDirectory) (f :: dirs, files) - else if (f.getName.endsWith(".check")) (dirs, files) - else if (f.getName.endsWith(".flags")) (dirs, files) - else (dirs, f :: files) + else if (isSourceFile(f)) (dirs, f :: files) + else (dirs, files) } /** Gets the name of the calling method via reflection. |