aboutsummaryrefslogtreecommitdiff
path: root/compiler/test
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2017-03-31 12:03:26 +0200
committerMartin Odersky <odersky@gmail.com>2017-03-31 13:02:12 +0200
commitbbd9aeb68b8e1690c24a598c55fc7c1acc89b71f (patch)
treeb2e2a4139515abd97e0c242fee273ed249ce580c /compiler/test
parentf3707992ee2ed56ce754df8c0760fc3928f0317f (diff)
downloaddotty-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')
-rw-r--r--compiler/test/dotty/tools/dotc/ParallelTesting.scala5
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.