Skip to content

Commit 5e90176

Browse files
committed
errors populating temp directory with jars not treated as a test failure
1 parent f5daaa2 commit 5e90176

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

compiler/test/dotty/tools/io/ClasspathTest.scala

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,13 @@ class ClasspathTest {
2323
val outDir = Files.createTempDirectory("classpath-test")
2424
try
2525
val compilerLib = "dist/target/pack/lib"
26-
for src <- Paths.get(compilerLib).toFile.listFiles.toList.take(5) do
27-
val dest = Paths.get(s"$outDir/${src.getName}")
28-
printf("copy: %s\n",Files.copy(src.toPath,dest)) // ,REPLACE_EXISTING,COPY_ATTRIBUTES))
26+
val libdir = Paths.get(compilerLib).toFile
27+
if libdir.exists then
28+
try for src <- libdir.listFiles.toList.take(5) do
29+
val dest = Paths.get(s"$outDir/${src.getName}")
30+
printf("copy: %s\n",Files.copy(src.toPath,dest)) // ,REPLACE_EXISTING,COPY_ATTRIBUTES))
31+
catch
32+
case _:NullPointerException => // ignore errors adding jars to outDir
2933

3034
//outDir.toFile.listFiles.toList.foreach { printf("%s\n",_) }
3135
val cp = Seq(s"$compilerLib/*",s"$outDir/*","not-a-real-directory/*").mkString(pathsep).replace('\\','/')

0 commit comments

Comments
 (0)