Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
with:
linux_swift_versions: '["nightly-main", "nightly-6.2"]'
linux_os_versions: '["amazonlinux2", "jammy"]'
windows_swift_versions: '["nightly-main", "nightly-6.2"]'
enable_macos_checks: true
macos_exclude_xcode_versions: "[{\"xcode_version\": \"16.2\"}, {\"xcode_version\": \"16.3\"}]"
Expand Down
2 changes: 1 addition & 1 deletion Sources/Testing/ExitTests/ExitTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -525,11 +525,11 @@ func callExitTest(
}

// Plumb the exit test's result through the general expectation machinery.
let expression = __Expression(String(describingForTest: expectedExitCondition))
return __checkValue(
expectedExitCondition.isApproximatelyEqual(to: result.exitStatus),
expression: expression,
expressionWithCapturedRuntimeValues: expression.capturingRuntimeValues(result.exitStatus),
mismatchedExitConditionDescription: String(describingForTest: expectedExitCondition),
comments: comments(),
isRequired: isRequired,
sourceLocation: sourceLocation
Expand Down
4 changes: 2 additions & 2 deletions Sources/Testing/Support/FileHandle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -704,9 +704,9 @@ func setFD_CLOEXEC(_ flag: Bool, onFileDescriptor fd: CInt) throws {
throw CError(rawValue: swt_errno())
case let oldValue:
let newValue = if flag {
oldValue & ~FD_CLOEXEC
} else {
oldValue | FD_CLOEXEC
} else {
oldValue & ~FD_CLOEXEC
}
if oldValue == newValue {
// No need to make a second syscall as nothing has changed.
Expand Down
17 changes: 12 additions & 5 deletions Tests/TestingTests/ExitTestTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,19 @@ private import _TestingInternals
#if !SWT_NO_EXIT_TESTS
@Suite("Exit test tests") struct ExitTestTests {
@Test("Signal names are reported (where supported)") func signalName() {
let exitStatus = ExitStatus.signal(SIGABRT)
#if SWT_TARGET_OS_APPLE || os(Linux) || os(FreeBSD) || os(OpenBSD) || os(Android)
#expect(String(describing: exitStatus) == ".signal(SIGABRT → \(SIGABRT))")
#else
#expect(String(describing: exitStatus) == ".signal(\(SIGABRT))")
var hasSignalNames = false
#if SWT_TARGET_OS_APPLE || os(FreeBSD) || os(OpenBSD) || os(Android)
hasSignalNames = true
#elseif os(Linux) && !SWT_NO_DYNAMIC_LINKING
hasSignalNames = (symbol(named: "sigabbrev_np") != nil)
#endif

let exitStatus = ExitStatus.signal(SIGABRT)
if hasSignalNames {
#expect(String(describing: exitStatus) == ".signal(SIGABRT → \(SIGABRT))")
} else {
#expect(String(describing: exitStatus) == ".signal(\(SIGABRT))")
}
}

@Test("Exit tests (passing)") func passing() async {
Expand Down