diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 8c8480260..288a012a1 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -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\"}]" diff --git a/Sources/Testing/ExitTests/ExitTest.swift b/Sources/Testing/ExitTests/ExitTest.swift index 32e930e0d..b9ce39496 100644 --- a/Sources/Testing/ExitTests/ExitTest.swift +++ b/Sources/Testing/ExitTests/ExitTest.swift @@ -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 diff --git a/Sources/Testing/Support/FileHandle.swift b/Sources/Testing/Support/FileHandle.swift index 37774b91a..d038db101 100644 --- a/Sources/Testing/Support/FileHandle.swift +++ b/Sources/Testing/Support/FileHandle.swift @@ -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. diff --git a/Tests/TestingTests/ExitTestTests.swift b/Tests/TestingTests/ExitTestTests.swift index 1801a21b4..615ffcb74 100644 --- a/Tests/TestingTests/ExitTestTests.swift +++ b/Tests/TestingTests/ExitTestTests.swift @@ -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 Bool(hasSignalNames) { + #expect(String(describing: exitStatus) == ".signal(SIGABRT → \(SIGABRT))") + } else { + #expect(String(describing: exitStatus) == ".signal(\(SIGABRT))") + } } @Test("Exit tests (passing)") func passing() async {