@@ -31,7 +31,7 @@ fileprivate struct DependencyVerificationTaskConstructionTests: CoreBasedTests {
31
31
32
32
@Test
33
33
func addsTraceArgsWhenDependenciesDeclared( ) async throws {
34
- try await testWith ( dependencies : [ " Foo " ] ) { tester, srcroot in
34
+ try await testWith ( [ " DEPENDENCIES " : " Foo " ] ) { tester, srcroot in
35
35
await tester. checkBuild ( runDestination: . macOS) { results in
36
36
results. checkTask ( . matchRuleType( " Ld " ) ) { task in
37
37
task. checkCommandLineContains ( [
@@ -44,7 +44,7 @@ fileprivate struct DependencyVerificationTaskConstructionTests: CoreBasedTests {
44
44
" -Xclang " , " -header-include-file " ,
45
45
" -Xclang " , outputFile ( srcroot, " \( sourceBaseName) .o.trace.json " ) ,
46
46
" -Xclang " , " -header-include-filtering=only-direct-system " ,
47
- " -Xclang " , " -header-include-format=json "
47
+ " -Xclang " , " -header-include-format=json " ,
48
48
] )
49
49
}
50
50
}
@@ -53,7 +53,7 @@ fileprivate struct DependencyVerificationTaskConstructionTests: CoreBasedTests {
53
53
54
54
@Test
55
55
func noTraceArgsWhenDependenciesDeclared( ) async throws {
56
- try await testWith ( dependencies : [ ] ) { tester, srcroot in
56
+ try await testWith ( [ : ] ) { tester, srcroot in
57
57
await tester. checkBuild ( runDestination: . macOS) { results in
58
58
results. checkTask ( . matchRuleType( " Ld " ) ) { task in
59
59
task. checkCommandLineDoesNotContain ( " -trace_file " )
@@ -65,7 +65,21 @@ fileprivate struct DependencyVerificationTaskConstructionTests: CoreBasedTests {
65
65
}
66
66
}
67
67
68
- private func testWith( dependencies: [ String ] , _ assertions: ( _ tester: TaskConstructionTester , _ srcroot: Path ) async throws -> Void ) async throws {
68
+ @Test
69
+ func canEnableVerificationOfNoDependencies( ) async throws {
70
+ try await testWith ( [ " DEPENDENCIES_VERIFICATION " : " YES " ] ) { tester, srcroot in
71
+ await tester. checkBuild ( runDestination: . macOS) { results in
72
+ results. checkTask ( . matchRuleType( " Ld " ) ) { task in
73
+ task. checkCommandLineContains ( [ " -Xlinker " , " -trace_file " , ] )
74
+ }
75
+ }
76
+ }
77
+ }
78
+
79
+ private func testWith(
80
+ _ buildSettings: [ String : String ] ,
81
+ _ assertions: ( _ tester: TaskConstructionTester , _ srcroot: Path ) async throws -> Void
82
+ ) async throws {
69
83
let testProject = TestProject (
70
84
project,
71
85
groupTree: TestGroup (
@@ -77,11 +91,11 @@ fileprivate struct DependencyVerificationTaskConstructionTests: CoreBasedTests {
77
91
TestBuildConfiguration (
78
92
" Debug " ,
79
93
buildSettings: [
80
- " DEPENDENCIES " : dependencies. joined ( separator: " " ) ,
81
94
" PRODUCT_NAME " : " $(TARGET_NAME) " ,
82
95
" GENERATE_INFOPLIST_FILE " : " YES " ,
83
- " CLANG_ENABLE_MODULES " : " YES "
84
- ] )
96
+ " CLANG_ENABLE_MODULES " : " YES " ,
97
+ ] . merging ( buildSettings) { _, new in new }
98
+ )
85
99
] ,
86
100
targets: [
87
101
TestStandardTarget (
0 commit comments