File tree Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Original file line number Diff line number Diff line change 3
3
* Use of this source code is governed by the Apache 2.0 license that can be found in the LICENCE file.
4
4
*/
5
5
6
+ import org.gradle.internal.os.OperatingSystem
6
7
import org.jetbrains.dokka.gradle.DokkaTaskPartial
7
8
8
9
plugins {
@@ -30,6 +31,17 @@ kotlin {
30
31
}
31
32
}
32
33
}
34
+ wasmWasi {
35
+ nodejs {
36
+ testTask {
37
+ // fd_readdir is unsupported on Windows:
38
+ // https://github.com/nodejs/node/blob/6f4d6011ea1b448cf21f5d363c44e4a4c56ca34c/deps/uvwasi/src/uvwasi.c#L19
39
+ if (OperatingSystem .current().isWindows) {
40
+ filter.setExcludePatterns(" *SmokeFileTest.listDirectory" )
41
+ }
42
+ }
43
+ }
44
+ }
33
45
34
46
sourceSets {
35
47
commonMain.dependencies {
Original file line number Diff line number Diff line change @@ -311,6 +311,8 @@ internal object WasiFileSystem : SystemFileSystemImpl() {
311
311
val bufferSize = metadata.filesize.toInt()
312
312
val buffer = allocator.allocate(bufferSize)
313
313
val resultSize: Int
314
+ // Unsuported on Windows and Android:
315
+ // https://github.com/nodejs/node/blob/6f4d6011ea1b448cf21f5d363c44e4a4c56ca34c/deps/uvwasi/src/uvwasi.c#L19
314
316
val res = Errno (
315
317
fd_readdir(
316
318
fd = dir_fd,
Original file line number Diff line number Diff line change @@ -219,4 +219,14 @@ class WasiFsTest {
219
219
SystemFileSystem .delete(Path (" /tmp/a" ))
220
220
}
221
221
}
222
+
223
+ // https://github.com/nodejs/node/blob/6f4d6011ea1b448cf21f5d363c44e4a4c56ca34c/deps/uvwasi/src/uvwasi.c#L19
224
+ @Test
225
+ fun readdirUnsupportedOnWindows () {
226
+ if (! isWindows) return
227
+
228
+ assertFailsWith<IOException > {
229
+ SystemFileSystem .list(PreOpens .roots.first())
230
+ }
231
+ }
222
232
}
You can’t perform that action at this time.
0 commit comments