                 XCTAssertTrue(stderr.contains("error: 'Foo' is not a Swift language target"))
             }
         }
-        #else
-        throw XCTSkip("Test unsupported on current platform")
-        #endif
     }
 
     func testNoBreakingChanges() throws {
-        #if os(macOS)
-        guard (try? Resources.default.toolchain.getSwiftAPIDigester()) != nil else {
-            throw XCTSkip("swift-api-digester not available")
-        }
+        try skipIfApiDigesterUnsupported()
         fixture(name: "Miscellaneous/APIDiff/") { prefix in
             let packageRoot = prefix.appending(component: "Bar")
             // Introduce an API-compatible change

            XCTAssertTrue(output.contains("No breaking changes detected in Baz"))
            XCTAssertTrue(output.contains("No breaking changes detected in Qux"))
        }
        #else
        throw XCTSkip("Test unsupported on current platform")
        #endif
    }

    func testAPIDiffAfterAddingNewTarget() throws {
        #if os(macOS)
        guard (try? Resources.default.toolchain.getSwiftAPIDigester()) != nil else {
            throw XCTSkip("swift-api-digester not available")
        }
        fixture(name: "Miscellaneous/APIDiff/") { prefix in
            let packageRoot = prefix.appending(component: "Bar")
            try localFileSystem.createDirectory(packageRoot.appending(components: "Sources", "Foo"))

        return try SwiftPMProduct.SwiftPackage.execute(args, packagePath: packagePath, env: environment)
    }

    func skipIfApiDigesterUnsupported() throws {
      guard let tool = try? Resources.default.toolchain.getSwiftAPIDigester() else {
        throw XCTSkip("swift-api-digester unavailable")
      }
      guard localFileSystem.isSymlink(tool) else {
        // The version of Swift with a supported swift-api-digester doesn't have
        // a version number yet, so use whether or not the tool is a symlink to
        // determine if it's from a recent snapshot.
        throw XCTSkip("swift-api-digester is too old")
      }
    }

    func testSimpleAPIDiff() throws {
        try skipIfApiDigesterUnsupported()
        fixture(name: "Miscellaneous/APIDiff/") { prefix in
            let packageRoot = prefix.appending(component: "Foo")
            // Overwrite the existing decl.
