@@ -19,8 +19,14 @@ import XCTest
19
19
20
20
final class ClangTargetBuildDescriptionTests : XCTestCase {
21
21
func testClangIndexStorePath( ) throws {
22
- let targetDescription = try makeTargetBuildDescription ( )
22
+ let targetDescription = try makeTargetBuildDescription ( " test " )
23
23
XCTAssertTrue ( try targetDescription. basicArguments ( ) . contains ( " -index-store-path " ) )
24
+ XCTAssertFalse ( try targetDescription. basicArguments ( ) . contains ( " -w " ) )
25
+ }
26
+
27
+ func testWarningSuppressionForRemotePackages( ) throws {
28
+ let targetDescription = try makeTargetBuildDescription ( " test-warning-supression " , usesSourceControl: true )
29
+ XCTAssertTrue ( try targetDescription. basicArguments ( ) . contains ( " -w " ) )
24
30
}
25
31
26
32
private func makeClangTarget( ) throws -> ClangTarget {
@@ -47,18 +53,25 @@ final class ClangTargetBuildDescriptionTests: XCTestCase {
47
53
)
48
54
}
49
55
50
- private func makeTargetBuildDescription( ) throws -> ClangTargetBuildDescription {
56
+ private func makeTargetBuildDescription( _ packageName: String ,
57
+ buildParameters: BuildParameters ? = nil ,
58
+ usesSourceControl: Bool = false ) throws -> ClangTargetBuildDescription {
51
59
let observability = ObservabilitySystem . makeForTesting ( verbose: false )
52
60
53
- let manifest = Manifest . createRootManifest (
54
- displayName: " dummy " ,
55
- toolsVersion: . v5,
56
- targets: [ try TargetDescription ( name: " dummy " ) ]
57
- )
61
+ let manifest : Manifest
62
+ if usesSourceControl {
63
+ manifest = Manifest . createLocalSourceControlManifest (
64
+ displayName: packageName, path: AbsolutePath ( " / \( packageName) " ) )
65
+ } else {
66
+ manifest = Manifest . createRootManifest (
67
+ displayName: packageName,
68
+ toolsVersion: . v5,
69
+ targets: [ try TargetDescription ( name: " dummy " ) ] )
70
+ }
58
71
59
72
let target = try makeResolvedTarget ( )
60
73
61
- let package = Package ( identity: . plain( " dummy " ) ,
74
+ let package = Package ( identity: . plain( packageName ) ,
62
75
manifest: manifest,
63
76
path: . root,
64
77
targets: [ target. underlying] ,
@@ -77,7 +90,7 @@ final class ClangTargetBuildDescriptionTests: XCTestCase {
77
90
platformVersionProvider: . init( implementation: . minimumDeploymentTargetDefault) ) ,
78
91
target: target,
79
92
toolsVersion: . current,
80
- buildParameters: mockBuildParameters (
93
+ buildParameters: buildParameters ?? mockBuildParameters (
81
94
toolchain: try UserToolchain . default,
82
95
indexStoreMode: . on
83
96
) ,
0 commit comments