Skip to content

Commit 88a19cf

Browse files
authoredNov 26, 2020
Merge pull request #4300 from sjrd/fix-windows-stuff
Fix usages of Jimfs in tests on Windows.
2 parents b5aaaf4 + 6284c6b commit 88a19cf

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed
 

‎appveyor.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ environment:
44
global:
55
NODEJS_VERSION: "12"
66
JAVA_HOME: C:\Program Files\Java\jdk1.8.0
7-
SCALA_VERSION: 2.12.11
7+
SCALA_VERSION: 2.12.12
88
install:
99
- ps: Install-Product node $env:NODEJS_VERSION
1010
- npm install
@@ -14,7 +14,8 @@ install:
1414
build: off
1515
test_script:
1616
# Very far from testing everything, but at least it is a good sanity check
17-
- cmd: sbt ";clean;++%SCALA_VERSION%;testSuite2_12/test"
17+
# For slow things (partest and scripted), we execute only one test
18+
- cmd: sbt ";clean;++%SCALA_VERSION%;testSuite2_12/test;linker2_12/test;partestSuite2_12/testOnly -- --fastOpt run/option-fold.scala;sbtPlugin/scripted settings/module-init"
1819
cache:
1920
- C:\sbt
2021
- C:\Users\appveyor\.ivy2\cache

‎linker/jvm/src/test/scala/org/scalajs/linker/PathOutputDirectoryTest.scala

+3-3
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class PathOutputDirectoryTest {
3636

3737
@Test
3838
def avoidUnnecessaryWrite(): AsyncResult = await {
39-
val dir = Jimfs.newFileSystem().getPath("/tmp")
39+
val dir = Jimfs.newFileSystem().getPath("tmp").toAbsolutePath()
4040
Files.createDirectory(dir)
4141

4242
val fileName = "file.js"
@@ -59,7 +59,7 @@ class PathOutputDirectoryTest {
5959

6060
@Test
6161
def readFull(): AsyncResult = await {
62-
val dir = Jimfs.newFileSystem().getPath("/tmp")
62+
val dir = Jimfs.newFileSystem().getPath("tmp").toAbsolutePath()
6363
Files.createDirectory(dir)
6464

6565
val fileName = "file.js"
@@ -82,7 +82,7 @@ class PathOutputDirectoryTest {
8282
.setAttributeViews("basic", "posix")
8383
.build()
8484

85-
val dir = Jimfs.newFileSystem(config).getPath("/tmp")
85+
val dir = Jimfs.newFileSystem(config).getPath("/tmp") // we forced Unix, so /tmp is fine
8686
Files.createDirectory(dir)
8787

8888
val fileName = "file.js"

‎partest/src/main/scala/scala/tools/nsc/MainGenericRunner.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ class MainGenericRunner {
9696
val linker = StandardImpl.linker(linkerConfig)
9797

9898
val sjsCode = {
99-
val dir = Jimfs.newFileSystem().getPath("/tmp")
99+
val dir = Jimfs.newFileSystem().getPath("tmp").toAbsolutePath()
100100
Files.createDirectory(dir)
101101

102102
val cache = StandardImpl.irFileCache().newCache

0 commit comments

Comments
 (0)