Commit Graph

6 Commits

Author SHA1 Message Date
Robert Widmann
cddf73ecdb [Gardening] Clean Up OS-Test Patterns Across The Codebase
Clean up a few general patterns that are now obviated by canImport

This aligns more generally with the cleanup that the Swift Package
Manager has already done in their automated XCTest-plumbing tool in
apple/swift-package-manager#1826.
2020-06-30 22:55:58 -07:00
Rintaro Ishizaki
0aa3125b62 [Testing] Eliminate REQUIRES-ANY usage
REQUIRES-ANY is deprecated and being removed. Use boolean expressions.

rdar://problem/58549266
2020-01-14 10:21:49 -08:00
Daniel Rodríguez Troitiño
699b4821de [test] Enable impossible to support test POSIXErrorCode.
The REQUIRES written one in each line were impossible to satisfy in any
platform, so the test wasn't running at all. This was changed to a
REQUIRE-ANY listing all the platforms (and adding Android). I also
needed to add runAllTest() at the end to make the test pass.
2019-05-06 17:44:32 -07:00
Daniel Rodríguez Troitiño
d08b46c47e [tests] Standarize the checks for Darwin, Glibc and MSVCRT.
Different tests used different os checks for importing Darwin, Glibc and
MSVCRT. This commit use the same pattern for importing those libraries,
in order to avoid the #else branches of the incorrect patterns to be
applied to the wrong platform. This was very normal for Android, which
normally should follow the Linux branches, but sometimes was trying to
import Darwin or not importing anything.

The standarized pattern imports Darwin for macOS, iOS, tvOS and watchOS.
It imports Glibc for Linux, FreeBSD, PS4, Android, Cygwin and Haiku; and
imports MSVCRT for Windows. If a new platform is introduced, the else
branch will report an error, so the new platform can be added to one of
the branches (or maybe add a new specific branch).

In some cases  the standard pattern was modified because some test required
it (importing extra modules, or extra type aliases), and in some other
cases some branches were removed because the test will not have used
them (but it is not exhaustive, so there might be some unnecessary
branches).

This should, at least, fix three tests for Android (the three
dynamic_replacement*.swift ones).
2019-02-06 10:51:55 -08:00
Robert Widmann
cde11ae1ee Resolve comments from last code review 2017-01-10 10:45:18 -07:00
Alsey Coleman Miller
8157194e83 [stdlib] Added POSIXErrorCode for Linux 2017-01-10 10:40:00 -07:00