Skip to content

Commit e43c058

Browse files
authored
Merge pull request #3343 from uraimo/glibc-test
2 parents 4c741cd + c145ac2 commit e43c058

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

validation-test/stdlib/Glibc.swift

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,34 @@
11
// RUN: %target-run-stdlib-swift
22
// REQUIRES: executable_test
33

4-
// REQUIRES: OS=linux-gnu
5-
64
import Swift
75
import StdlibUnittest
86

9-
7+
#if os(Linux) || os(FreeBSD)
108
import Glibc
9+
#endif
1110

1211
var GlibcTestSuite = TestSuite("Glibc")
1312

14-
GlibcTestSuite.test("errno") {
15-
errno = 0
16-
expectEqual(0, errno)
17-
close(-1)
18-
expectEqual(EBADF, errno)
13+
GlibcTestSuite.test("errno")
14+
.skip(.custom({
15+
!( linuxAny(reason: "").evaluate() || freeBSDAny(reason: "").evaluate() )
16+
}, reason: "Only Linux and FreeBSD are supported")).code {
17+
errno = 0
18+
expectEqual(0, errno)
19+
close(-1)
20+
expectEqual(EBADF, errno)
1921
}
2022

23+
2124
var GlibcIoctlConstants = TestSuite("GlibcIoctlConstants")
2225

23-
GlibcIoctlConstants.test("tty ioctl constants availability") {
24-
let aConstant = TIOCGWINSZ
26+
GlibcIoctlConstants.test("tty ioctl constants availability")
27+
.skip(.custom({
28+
!( linuxAny(reason: "").evaluate() || freeBSDAny(reason: "").evaluate() )
29+
}, reason: "Only Linux and FreeBSD are supported")).code {
30+
let aConstant = TIOCGWINSZ
2531
}
2632

33+
2734
runAllTests()

0 commit comments

Comments
 (0)