Skip to content

Commit 429da7c

Browse files
committed
test: split ModuleDependencyGraph into graph and action
1 parent 38c0452 commit 429da7c

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

test/ScanDependencies/Inputs/ModuleDependencyGraph.swift

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,3 @@ struct ModuleDependencyGraph: Codable {
144144
/// Information about the main module.
145145
var mainModule: ModuleDependencies { modules[.swift(mainModuleName)]! }
146146
}
147-
148-
let fileName = CommandLine.arguments[1]
149-
let data = try! Data(contentsOf: URL(fileURLWithPath: fileName))
150-
151-
let decoder = JSONDecoder()
152-
let moduleDependencyGraph = try! decoder.decode(
153-
ModuleDependencyGraph.self, from: data)
154-
print(moduleDependencyGraph)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import Foundation
2+
3+
let fileName = CommandLine.arguments[1]
4+
let data = try! Data(contentsOf: URL(fileURLWithPath: fileName))
5+
6+
let decoder = JSONDecoder()
7+
let moduleDependencyGraph = try! decoder.decode(
8+
ModuleDependencyGraph.self, from: data)
9+
print(moduleDependencyGraph)

test/ScanDependencies/module_deps.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
// Check that the JSON parses correctly into the canonical Swift data
1212
// structures.
1313

14-
// RUN: %target-build-swift %S/Inputs/ModuleDependencyGraph.swift -o %t/main
14+
// RUN: mkdir -p %t/PrintGraph
15+
// RUN: cp %S/Inputs/PrintGraph.swift %t/main.swift
16+
// RUN: %target-build-swift %S/Inputs/ModuleDependencyGraph.swift %t/main.swift -o %t/main
1517
// RUN: %target-codesign %t/main
1618
// RUN: %target-run %t/main %t/deps.json
1719

0 commit comments

Comments
 (0)