Skip to content

Commit d25b634

Browse files
authored
Revert "Skip tests which need -suppress-warnings to work if it doesn't work" (#7294)
This reverts commit 6ba5b96 since the underlying issue has since been fixed.
1 parent a9ddddb commit d25b634

File tree

2 files changed

+0
-27
lines changed

2 files changed

+0
-27
lines changed

Sources/SPMTestSupport/Toolchain.swift

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -111,29 +111,6 @@ extension UserToolchain {
111111
}
112112
}
113113

114-
public func supportsSuppressWarnings() -> Bool {
115-
do {
116-
try testWithTemporaryDirectory { tmpPath in
117-
let inputPath = tmpPath.appending("best.swift")
118-
try localFileSystem.writeFileContents(inputPath, string: "let foo: String? = \"bar\"\nprint(foo)\n")
119-
let outputPath = tmpPath.appending("foo")
120-
let serializedDiagnosticsPath = tmpPath.appending("out.dia")
121-
let toolchainPath = self.swiftCompilerPath.parentDirectory.parentDirectory
122-
try Process.checkNonZeroExit(arguments: ["/usr/bin/xcrun", "--toolchain", toolchainPath.pathString, "swiftc", inputPath.pathString, "-Xfrontend", "-serialize-diagnostics-path", "-Xfrontend", serializedDiagnosticsPath.pathString, "-o", outputPath.pathString, "-suppress-warnings"])
123-
124-
let diaFileContents = try localFileSystem.readFileContents(serializedDiagnosticsPath)
125-
let diagnosticsSet = try SerializedDiagnostics(bytes: diaFileContents)
126-
127-
if diagnosticsSet.diagnostics.contains(where: { $0.text.contains("warning") }) {
128-
throw StringError("does not support suppressing warnings")
129-
}
130-
}
131-
return true
132-
} catch {
133-
return false
134-
}
135-
}
136-
137114
// This builds a trivial program with `-warnings-as-errors`, if it fails, the compiler in use generates warnings by default and is not suitable for testing warnings as errors behaviors.
138115
public func supportsWarningsAsErrors() -> Bool {
139116
do {

Tests/FunctionalTests/MiscellaneousTests.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -630,8 +630,6 @@ class MiscellaneousTestCase: XCTestCase {
630630
}
631631

632632
func testNoWarningFromRemoteDependencies() throws {
633-
try XCTSkipIf(!UserToolchain.default.supportsSuppressWarnings(), "skipping because test environment doesn't support suppressing warnings")
634-
635633
try fixture(name: "Miscellaneous/DependenciesWarnings") { path in
636634
// prepare the deps as git sources
637635
let dependency1Path = path.appending("dep1")
@@ -649,8 +647,6 @@ class MiscellaneousTestCase: XCTestCase {
649647
}
650648

651649
func testNoWarningFromRemoteDependenciesWithWarningsAsErrors() throws {
652-
try XCTSkipIf(!UserToolchain.default.supportsSuppressWarnings(), "skipping because test environment doesn't support suppressing warnings")
653-
654650
try fixture(name: "Miscellaneous/DependenciesWarnings2") { path in
655651
// prepare the deps as git sources
656652
let dependency1Path = path.appending("dep1")

0 commit comments

Comments
 (0)