Skip to content

Commit 84ad70e

Browse files
committed
Tests: Address unused variable warnings.
1 parent 22916b3 commit 84ad70e

File tree

2 files changed

+2
-41
lines changed

2 files changed

+2
-41
lines changed

Tests/SwiftDriverTests/DependencyGraphSerializationTests.swift

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,7 @@ class DependencyGraphSerializationTests: XCTestCase, ModuleDependencyGraphMocker
2727
let graph = Self.mockGraphCreator.mockUpAGraph()
2828
let currentVersion = ModuleDependencyGraph.serializedGraphVersion
2929
let alteredVersion = currentVersion.withAlteredMinor
30-
let outputFileMap = OutputFileMap.mock(maxIndex: Self.maxIndex)
31-
let diagnosticsEngine = DiagnosticsEngine()
32-
let info = BuildRecordInfo.mock(
33-
diagnosticEngine: diagnosticsEngine,
34-
outputFileMap: outputFileMap,
35-
compilerVersion: "Swift 99")
30+
3631
try graph.blockingConcurrentAccessOrMutation {
3732
try graph.write(
3833
to: mockPath,
@@ -63,11 +58,7 @@ class DependencyGraphSerializationTests: XCTestCase, ModuleDependencyGraphMocker
6358
let mockPath = try VirtualPath.absolute(AbsolutePath(validating: "/module-dependency-graph"))
6459
let fs = InMemoryFileSystem()
6560
let outputFileMap = OutputFileMap.mock(maxIndex: Self.maxIndex)
66-
let diagnosticsEngine = DiagnosticsEngine()
67-
let buildRecord = BuildRecordInfo.mock(
68-
diagnosticEngine: diagnosticsEngine,
69-
outputFileMap: outputFileMap,
70-
compilerVersion: "Swift 99")
61+
7162
try originalGraph.blockingConcurrentMutation {
7263
try originalGraph.write(
7364
to: mockPath, on: fs,

Tests/SwiftDriverTests/ExplicitModuleBuildTests.swift

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -73,36 +73,6 @@ private func checkExplicitModuleBuildJobDependencies(job: Job,
7373
moduleInfo : ModuleInfo,
7474
dependencyGraph: InterModuleDependencyGraph
7575
) throws {
76-
var validateModuleMapCommandLineDependency: (ModuleDependencyId, ModuleInfo) throws -> Void = { dependencyId, dependencyInfo in
77-
// Load the dependency JSON and verify this dependency was encoded correctly
78-
let explicitDepsFlag =
79-
SwiftDriver.Job.ArgTemplate.flag(String("-explicit-swift-module-map-file"))
80-
XCTAssert(job.commandLine.contains(explicitDepsFlag))
81-
let jsonDepsPathIndex = job.commandLine.firstIndex(of: explicitDepsFlag)
82-
let jsonDepsPathArg = job.commandLine[jsonDepsPathIndex! + 1]
83-
guard case .path(let jsonDepsPath) = jsonDepsPathArg else {
84-
XCTFail("No JSON dependency file path found.")
85-
return
86-
}
87-
guard case let .temporaryWithKnownContents(_, contents) = jsonDepsPath else {
88-
XCTFail("Unexpected path type")
89-
return
90-
}
91-
let dependencyInfoList = try JSONDecoder().decode(Array<SwiftModuleArtifactInfo>.self,
92-
from: contents)
93-
let dependencyArtifacts =
94-
dependencyInfoList.first(where:{ $0.moduleName == dependencyId.moduleName })
95-
XCTAssertEqual(dependencyArtifacts!.modulePath, dependencyInfo.modulePath)
96-
}
97-
98-
99-
let validateSwiftCommandLineDependency: (ModuleDependencyId, ModuleInfo) -> Void = { dependencyId, dependencyInfo in
100-
let inputModulePath = dependencyInfo.modulePath.path
101-
XCTAssertTrue(job.inputs.contains(TypedVirtualPath(file: inputModulePath, type: .swiftModule)))
102-
XCTAssertTrue(job.commandLine.contains(
103-
.flag(String("-swift-module-file=\(dependencyId.moduleName)=\(inputModulePath.description)"))))
104-
}
105-
10676
let validateClangCommandLineDependency: (ModuleDependencyId,
10777
ModuleInfo,
10878
ClangModuleDetails) -> Void = { dependencyId, dependencyInfo, clangDependencyDetails in

0 commit comments

Comments
 (0)