diff --git a/Tests/SwiftDocCTests/Infrastructure/DocumentationBundleTests.swift b/Tests/SwiftDocCTests/Infrastructure/DocumentationBundleTests.swift index 8d03e4f30..4671760ea 100644 --- a/Tests/SwiftDocCTests/Infrastructure/DocumentationBundleTests.swift +++ b/Tests/SwiftDocCTests/Infrastructure/DocumentationBundleTests.swift @@ -1,7 +1,7 @@ /* This source file is part of the Swift.org open source project - Copyright (c) 2021 Apple Inc. and the Swift project authors + Copyright (c) 2021-2025 Apple Inc. and the Swift project authors Licensed under Apache License v2.0 with Runtime Library Exception See https://swift.org/LICENSE.txt for license information @@ -9,7 +9,6 @@ */ import XCTest -@testable import SwiftDocC class DocumentationBundleTests: XCTestCase { // Test whether the bundle correctly loads a documentation source folder. diff --git a/Tests/SwiftDocCTests/Infrastructure/InheritIntroducedAvailabilityTests.swift b/Tests/SwiftDocCTests/Infrastructure/InheritIntroducedAvailabilityTests.swift index 77bf00bc0..1602d4dee 100644 --- a/Tests/SwiftDocCTests/Infrastructure/InheritIntroducedAvailabilityTests.swift +++ b/Tests/SwiftDocCTests/Infrastructure/InheritIntroducedAvailabilityTests.swift @@ -34,16 +34,14 @@ class InheritIntroducedAvailabilityTests: XCTestCase { typealias Domain = SymbolGraph.Symbol.Availability.Domain typealias Version = SymbolGraph.SemanticVersion - var testBundle: DocumentationBundle! var context: DocumentationContext! override func setUp() async throws { try await super.setUp() - (testBundle, context) = try await testBundleAndContext(named: "LegacyBundle_DoNotUseInNewTests") + (_, context) = try await testBundleAndContext(named: "LegacyBundle_DoNotUseInNewTests") } override func tearDown() { - testBundle = nil context = nil super.tearDown() } diff --git a/Tests/SwiftDocCTests/Infrastructure/NodeURLGeneratorTests.swift b/Tests/SwiftDocCTests/Infrastructure/NodeURLGeneratorTests.swift index 422f2e285..55da5f9f3 100644 --- a/Tests/SwiftDocCTests/Infrastructure/NodeURLGeneratorTests.swift +++ b/Tests/SwiftDocCTests/Infrastructure/NodeURLGeneratorTests.swift @@ -1,7 +1,7 @@ /* This source file is part of the Swift.org open source project - Copyright (c) 2021-2024 Apple Inc. and the Swift project authors + Copyright (c) 2021-2025 Apple Inc. and the Swift project authors Licensed under Apache License v2.0 with Runtime Library Exception See https://swift.org/LICENSE.txt for license information @@ -14,8 +14,6 @@ import XCTest @testable import SwiftDocC class NodeURLGeneratorTests: XCTestCase { - let generator = NodeURLGenerator() - let unchangedURLs = [ URL(string: "doc://com.bundle/folder-prefix/type/symbol")!, URL(string: "doc://com.bundle/fol.der-pref.ix./type-swift.class/symbol.name.")!, diff --git a/Tests/SwiftDocCTests/Model/ParametersAndReturnValidatorTests.swift b/Tests/SwiftDocCTests/Model/ParametersAndReturnValidatorTests.swift index 9a9316e54..912ac6fdb 100644 --- a/Tests/SwiftDocCTests/Model/ParametersAndReturnValidatorTests.swift +++ b/Tests/SwiftDocCTests/Model/ParametersAndReturnValidatorTests.swift @@ -910,9 +910,7 @@ class ParametersAndReturnValidatorTests: XCTestCase { docComment: String, docCommentModuleName: String? = "ModuleName", parameters: [(name: String, externalName: String?)], - returnValue: SymbolGraph.Symbol.DeclarationFragments.Fragment, - file: StaticString = #filePath, - line: UInt = #line + returnValue: SymbolGraph.Symbol.DeclarationFragments.Fragment ) async throws -> String { let fileSystem = try TestFileSystem(folders: [ Folder(name: "path", content: [ diff --git a/Tests/SwiftDocCTests/Model/TaskGroupTests.swift b/Tests/SwiftDocCTests/Model/TaskGroupTests.swift index 46207219f..c8e66f845 100644 --- a/Tests/SwiftDocCTests/Model/TaskGroupTests.swift +++ b/Tests/SwiftDocCTests/Model/TaskGroupTests.swift @@ -1,7 +1,7 @@ /* This source file is part of the Swift.org open source project - Copyright (c) 2021-2024 Apple Inc. and the Swift project authors + Copyright (c) 2021-2025 Apple Inc. and the Swift project authors Licensed under Apache License v2.0 with Runtime Library Exception See https://swift.org/LICENSE.txt for license information @@ -68,10 +68,6 @@ class SectionExtractionTests: XCTestCase { } } - private func testNode(with document: Document) -> DocumentationNode { - return DocumentationNode(reference: ResolvedTopicReference(bundleID: "org.swift.docc", path: "/blah", sourceLanguage: .swift), kind: .article, sourceLanguage: .swift, name: .conceptual(title: "Title"), markup: document, semantic: Semantic()) - } - func testSection() { // Empty -> nil do { diff --git a/Tests/SwiftDocCTests/Rendering/SymbolAvailabilityTests.swift b/Tests/SwiftDocCTests/Rendering/SymbolAvailabilityTests.swift index bdabcf442..239d35223 100644 --- a/Tests/SwiftDocCTests/Rendering/SymbolAvailabilityTests.swift +++ b/Tests/SwiftDocCTests/Rendering/SymbolAvailabilityTests.swift @@ -16,32 +16,6 @@ import SwiftDocCTestUtilities class SymbolAvailabilityTests: XCTestCase { - private func symbolAvailability( - defaultAvailability: [DefaultAvailability.ModuleAvailability] = [], - symbolGraphOperatingSystemPlatformName: String, - symbols: [SymbolGraph.Symbol], - symbolName: String - ) async throws -> [SymbolGraph.Symbol.Availability.AvailabilityItem] { - let catalog = Folder( - name: "unit-test.docc", - content: [ - InfoPlist(defaultAvailability: [ - "ModuleName": defaultAvailability - ]), - JSONFile(name: "ModuleName.symbols.json", content: makeSymbolGraph( - moduleName: "ModuleName", - platform: SymbolGraph.Platform(architecture: nil, vendor: nil, operatingSystem: SymbolGraph.OperatingSystem(name: symbolGraphOperatingSystemPlatformName), environment: nil), - symbols: symbols, - relationships: [] - )), - ] - ) - let (_, context) = try await loadBundle(catalog: catalog) - let reference = try XCTUnwrap(context.soleRootModuleReference).appendingPath(symbolName) - let symbol = try XCTUnwrap(context.entity(with: reference).semantic as? Symbol) - return try XCTUnwrap(symbol.availability?.availability) - } - private func renderNodeAvailability( defaultAvailability: [DefaultAvailability.ModuleAvailability] = [], symbolGraphOperatingSystemPlatformName: String, diff --git a/Tests/SwiftDocCTests/Utility/LMDBTests.swift b/Tests/SwiftDocCTests/Utility/LMDBTests.swift index 546190958..dd50b2960 100644 --- a/Tests/SwiftDocCTests/Utility/LMDBTests.swift +++ b/Tests/SwiftDocCTests/Utility/LMDBTests.swift @@ -1,7 +1,7 @@ /* This source file is part of the Swift.org open source project - Copyright (c) 2021 Apple Inc. and the Swift project authors + Copyright (c) 2021-2025 Apple Inc. and the Swift project authors Licensed under Apache License v2.0 with Runtime Library Exception See https://swift.org/LICENSE.txt for license information @@ -258,10 +258,6 @@ final class SwiftLMDBTests: XCTestCase { XCTAssertEqual(value, [1,2,3,4,5,6,7,8,9,10,11,12,13,14]) #endif } - - static var allTests = [ - ("testVersion", testVersion), - ] } // MARK: - Custom Objects diff --git a/Tests/SwiftDocCTests/Utility/SemanticVersion+ComparableTests.swift b/Tests/SwiftDocCTests/Utility/SemanticVersion+ComparableTests.swift index 83875cc26..e68dfba3d 100644 --- a/Tests/SwiftDocCTests/Utility/SemanticVersion+ComparableTests.swift +++ b/Tests/SwiftDocCTests/Utility/SemanticVersion+ComparableTests.swift @@ -1,7 +1,7 @@ /* This source file is part of the Swift.org open source project - Copyright (c) 2021 Apple Inc. and the Swift project authors + Copyright (c) 2021-2025 Apple Inc. and the Swift project authors Licensed under Apache License v2.0 with Runtime Library Exception See https://swift.org/LICENSE.txt for license information @@ -10,7 +10,6 @@ import XCTest import SymbolKit -@testable import SwiftDocC class SemanticVersion_ComparableTests: XCTestCase { private typealias Version = SymbolGraph.SemanticVersion diff --git a/Tests/SwiftDocCUtilitiesTests/ArgumentParsing/MergeSubcommandTests.swift b/Tests/SwiftDocCUtilitiesTests/ArgumentParsing/MergeSubcommandTests.swift index 3260ed4d2..85731b8e9 100644 --- a/Tests/SwiftDocCUtilitiesTests/ArgumentParsing/MergeSubcommandTests.swift +++ b/Tests/SwiftDocCUtilitiesTests/ArgumentParsing/MergeSubcommandTests.swift @@ -1,7 +1,7 @@ /* This source file is part of the Swift.org open source project - Copyright (c) 2024 Apple Inc. and the Swift project authors + Copyright (c) 2024-2025 Apple Inc. and the Swift project authors Licensed under Apache License v2.0 with Runtime Library Exception See https://swift.org/LICENSE.txt for license information @@ -11,7 +11,6 @@ import XCTest import ArgumentParser @testable import SwiftDocCUtilities -@testable import SwiftDocC import SwiftDocCTestUtilities class MergeSubcommandTests: XCTestCase { diff --git a/Tests/SwiftDocCUtilitiesTests/DirectoryMonitorTests.swift b/Tests/SwiftDocCUtilitiesTests/DirectoryMonitorTests.swift index 10bd4ac73..555d25822 100644 --- a/Tests/SwiftDocCUtilitiesTests/DirectoryMonitorTests.swift +++ b/Tests/SwiftDocCUtilitiesTests/DirectoryMonitorTests.swift @@ -1,7 +1,7 @@ /* This source file is part of the Swift.org open source project - Copyright (c) 2021 Apple Inc. and the Swift project authors + Copyright (c) 2021-2025 Apple Inc. and the Swift project authors Licensed under Apache License v2.0 with Runtime Library Exception See https://swift.org/LICENSE.txt for license information @@ -91,7 +91,7 @@ class DirectoryMonitorTests: XCTestCase { /// - Warning: Please do not overuse this method as it takes 10s of wait time and can potentially slow down running the test suite. private func monitorNoUpdates(url: URL, testBlock: @escaping () throws -> Void, file: StaticString = #filePath, line: UInt = #line) throws { let monitor = try DirectoryMonitor(root: url) { rootURL, url in - XCTFail("Did produce file update event for a hidden file") + XCTFail("Did produce file update event for a hidden file", file: file, line: line) } try monitor.start() diff --git a/Tests/SwiftDocCUtilitiesTests/FolderStructureTests.swift b/Tests/SwiftDocCUtilitiesTests/FolderStructureTests.swift index 8a9c6ad39..148da8625 100644 --- a/Tests/SwiftDocCUtilitiesTests/FolderStructureTests.swift +++ b/Tests/SwiftDocCUtilitiesTests/FolderStructureTests.swift @@ -1,7 +1,7 @@ /* This source file is part of the Swift.org open source project - Copyright (c) 2021 Apple Inc. and the Swift project authors + Copyright (c) 2021-2025 Apple Inc. and the Swift project authors Licensed under Apache License v2.0 with Runtime Library Exception See https://swift.org/LICENSE.txt for license information @@ -9,7 +9,6 @@ */ import XCTest -@testable import SwiftDocC import SwiftDocCTestUtilities class FolderStructureTests: XCTestCase { diff --git a/Tests/SwiftDocCUtilitiesTests/HTMLTemplateDirectory.swift b/Tests/SwiftDocCUtilitiesTests/HTMLTemplateDirectory.swift index 09ee4a179..e3f25527c 100644 --- a/Tests/SwiftDocCUtilitiesTests/HTMLTemplateDirectory.swift +++ b/Tests/SwiftDocCUtilitiesTests/HTMLTemplateDirectory.swift @@ -1,7 +1,7 @@ /* This source file is part of the Swift.org open source project - Copyright (c) 2021 Apple Inc. and the Swift project authors + Copyright (c) 2021-2025 Apple Inc. and the Swift project authors Licensed under Apache License v2.0 with Runtime Library Exception See https://swift.org/LICENSE.txt for license information @@ -9,7 +9,6 @@ */ import Foundation -@testable import SwiftDocC import SwiftDocCTestUtilities /// A folder that represents a fake html-build directory for testing. diff --git a/Tests/SwiftDocCUtilitiesTests/PreviewServer/PreviewHTTPHandlerTests.swift b/Tests/SwiftDocCUtilitiesTests/PreviewServer/PreviewHTTPHandlerTests.swift index 0a142f037..95878b0e7 100644 --- a/Tests/SwiftDocCUtilitiesTests/PreviewServer/PreviewHTTPHandlerTests.swift +++ b/Tests/SwiftDocCUtilitiesTests/PreviewServer/PreviewHTTPHandlerTests.swift @@ -1,7 +1,7 @@ /* This source file is part of the Swift.org open source project - Copyright (c) 2021 Apple Inc. and the Swift project authors + Copyright (c) 2021-2025 Apple Inc. and the Swift project authors Licensed under Apache License v2.0 with Runtime Library Exception See https://swift.org/LICENSE.txt for license information @@ -11,7 +11,6 @@ #if canImport(NIOHTTP1) import Foundation import XCTest -@testable import SwiftDocC @testable import SwiftDocCUtilities import SwiftDocCTestUtilities diff --git a/Tests/SwiftDocCUtilitiesTests/PreviewServer/RequestHandler/DefaultRequestHandlerTests.swift b/Tests/SwiftDocCUtilitiesTests/PreviewServer/RequestHandler/DefaultRequestHandlerTests.swift index e0321e1a8..634ba02b9 100644 --- a/Tests/SwiftDocCUtilitiesTests/PreviewServer/RequestHandler/DefaultRequestHandlerTests.swift +++ b/Tests/SwiftDocCUtilitiesTests/PreviewServer/RequestHandler/DefaultRequestHandlerTests.swift @@ -1,7 +1,7 @@ /* This source file is part of the Swift.org open source project - Copyright (c) 2021 Apple Inc. and the Swift project authors + Copyright (c) 2021-2025 Apple Inc. and the Swift project authors Licensed under Apache License v2.0 with Runtime Library Exception See https://swift.org/LICENSE.txt for license information @@ -11,7 +11,6 @@ #if canImport(NIOHTTP1) import Foundation import XCTest -@testable import SwiftDocC @testable import SwiftDocCUtilities import SwiftDocCTestUtilities diff --git a/Tests/SwiftDocCUtilitiesTests/PreviewServer/RequestHandler/ErrorRequestHandlerTests.swift b/Tests/SwiftDocCUtilitiesTests/PreviewServer/RequestHandler/ErrorRequestHandlerTests.swift index d73d8d8cc..552b51e71 100644 --- a/Tests/SwiftDocCUtilitiesTests/PreviewServer/RequestHandler/ErrorRequestHandlerTests.swift +++ b/Tests/SwiftDocCUtilitiesTests/PreviewServer/RequestHandler/ErrorRequestHandlerTests.swift @@ -1,7 +1,7 @@ /* This source file is part of the Swift.org open source project - Copyright (c) 2021 Apple Inc. and the Swift project authors + Copyright (c) 2021-2025 Apple Inc. and the Swift project authors Licensed under Apache License v2.0 with Runtime Library Exception See https://swift.org/LICENSE.txt for license information @@ -11,7 +11,6 @@ #if canImport(NIOHTTP1) import Foundation import XCTest -@testable import SwiftDocC @testable import SwiftDocCUtilities import NIO diff --git a/Tests/SwiftDocCUtilitiesTests/PreviewServer/RequestHandler/FileRequestHandlerTests.swift b/Tests/SwiftDocCUtilitiesTests/PreviewServer/RequestHandler/FileRequestHandlerTests.swift index 2f7b3202f..9d4fefa8e 100644 --- a/Tests/SwiftDocCUtilitiesTests/PreviewServer/RequestHandler/FileRequestHandlerTests.swift +++ b/Tests/SwiftDocCUtilitiesTests/PreviewServer/RequestHandler/FileRequestHandlerTests.swift @@ -1,7 +1,7 @@ /* This source file is part of the Swift.org open source project - Copyright (c) 2021 Apple Inc. and the Swift project authors + Copyright (c) 2021-2025 Apple Inc. and the Swift project authors Licensed under Apache License v2.0 with Runtime Library Exception See https://swift.org/LICENSE.txt for license information @@ -11,7 +11,6 @@ #if canImport(NIOHTTP1) import Foundation import XCTest -@testable import SwiftDocC @testable import SwiftDocCUtilities import SwiftDocCTestUtilities @@ -19,8 +18,6 @@ import NIO import NIOHTTP1 class FileRequestHandlerTests: XCTestCase { - let fileIO = NonBlockingFileIO(threadPool: NIOThreadPool(numberOfThreads: 2)) - private func verifyAsset(root: URL, path: String, body: String, type: String, file: StaticString = #filePath, line: UInt = #line) throws { let request = makeRequestHead(uri: path) let factory = FileRequestHandler(rootURL: root) diff --git a/Tests/SwiftDocCUtilitiesTests/SignalTests.swift b/Tests/SwiftDocCUtilitiesTests/SignalTests.swift index 564d0bc93..2bcd26c59 100644 --- a/Tests/SwiftDocCUtilitiesTests/SignalTests.swift +++ b/Tests/SwiftDocCUtilitiesTests/SignalTests.swift @@ -1,7 +1,7 @@ /* This source file is part of the Swift.org open source project - Copyright (c) 2021 Apple Inc. and the Swift project authors + Copyright (c) 2021-2025 Apple Inc. and the Swift project authors Licensed under Apache License v2.0 with Runtime Library Exception See https://swift.org/LICENSE.txt for license information @@ -9,7 +9,6 @@ */ import XCTest -@testable import SwiftDocCUtilities class SignalTests: XCTestCase { #if os(macOS) || os(Linux) || os(Android) diff --git a/Tests/SwiftDocCUtilitiesTests/StaticHostingBaseTest.swift b/Tests/SwiftDocCUtilitiesTests/StaticHostingBaseTest.swift index 3e50fae03..430ccd8b9 100644 --- a/Tests/SwiftDocCUtilitiesTests/StaticHostingBaseTest.swift +++ b/Tests/SwiftDocCUtilitiesTests/StaticHostingBaseTest.swift @@ -1,7 +1,7 @@ /* This source file is part of the Swift.org open source project - Copyright (c) 2021 Apple Inc. and the Swift project authors + Copyright (c) 2021-2025 Apple Inc. and the Swift project authors Licensed under Apache License v2.0 with Runtime Library Exception See https://swift.org/LICENSE.txt for license information @@ -10,8 +10,6 @@ import XCTest import Foundation -@testable import SwiftDocC -@testable import SwiftDocCUtilities class StaticHostingBaseTests: XCTestCase { diff --git a/Tests/SwiftDocCUtilitiesTests/Utility/FileTests.swift b/Tests/SwiftDocCUtilitiesTests/Utility/FileTests.swift index c8f3f2ead..cfabe527a 100644 --- a/Tests/SwiftDocCUtilitiesTests/Utility/FileTests.swift +++ b/Tests/SwiftDocCUtilitiesTests/Utility/FileTests.swift @@ -1,7 +1,7 @@ /* This source file is part of the Swift.org open source project - Copyright (c) 2021-2024 Apple Inc. and the Swift project authors + Copyright (c) 2021-2025 Apple Inc. and the Swift project authors Licensed under Apache License v2.0 with Runtime Library Exception See https://swift.org/LICENSE.txt for license information @@ -9,8 +9,6 @@ */ import XCTest -@testable import SwiftDocC -@testable import SwiftDocCUtilities import SwiftDocCTestUtilities class FileTests: XCTestCase {