@@ -887,9 +887,11 @@ class PackageGraphTests: XCTestCase {
887
887
func testUnsafeFlags( ) throws {
888
888
let fs = InMemoryFileSystem ( emptyFiles:
889
889
" /Foo/Sources/Foo/foo.swift " ,
890
+ " /Foo/Sources/Foo2/foo.swift " ,
890
891
" /Bar/Sources/Bar/bar.swift " ,
891
892
" /Bar/Sources/Bar2/bar.swift " ,
892
893
" /Bar/Sources/Bar3/bar.swift " ,
894
+ " /Bar/Sources/TransitiveBar/bar.swift " ,
893
895
" <end> "
894
896
)
895
897
@@ -906,14 +908,16 @@ class PackageGraphTests: XCTestCase {
906
908
] ,
907
909
targets: [
908
910
TargetDescription ( name: " Foo " , dependencies: [ " Bar " ] ) ,
911
+ TargetDescription ( name: " Foo2 " , dependencies: [ " TransitiveBar " ] ) ,
909
912
] ) ,
910
913
Manifest . createV4Manifest (
911
914
name: " Bar " ,
912
915
path: " /Bar " ,
913
916
url: " /Bar " ,
914
917
packageKind: . local,
915
918
products: [
916
- ProductDescription ( name: " Bar " , targets: [ " Bar " , " Bar2 " , " Bar3 " ] )
919
+ ProductDescription ( name: " Bar " , targets: [ " Bar " , " Bar2 " , " Bar3 " ] ) ,
920
+ ProductDescription ( name: " TransitiveBar " , targets: [ " TransitiveBar " ] ) ,
917
921
] ,
918
922
targets: [
919
923
TargetDescription (
@@ -933,14 +937,19 @@ class PackageGraphTests: XCTestCase {
933
937
TargetDescription (
934
938
name: " Bar3 "
935
939
) ,
940
+ TargetDescription (
941
+ name: " TransitiveBar " ,
942
+ dependencies: [ " Bar2 " ]
943
+ ) ,
936
944
] ) ,
937
945
]
938
946
)
939
947
940
- XCTAssertEqual ( diagnostics. diagnostics. count, 2 )
948
+ XCTAssertEqual ( diagnostics. diagnostics. count, 3 )
941
949
DiagnosticsEngineTester ( diagnostics, ignoreNotes: true ) { result in
942
- result. check ( diagnostic: . contains( " the target 'Bar' in product 'Bar' contains unsafe build flags " ) , behavior: . error)
943
- result. check ( diagnostic: . contains( " the target 'Bar2' in product 'Bar' contains unsafe build flags " ) , behavior: . error)
950
+ result. checkUnordered ( diagnostic: . contains( " the target 'Bar2' in product 'TransitiveBar' contains unsafe build flags " ) , behavior: . error)
951
+ result. checkUnordered ( diagnostic: . contains( " the target 'Bar' in product 'Bar' contains unsafe build flags " ) , behavior: . error)
952
+ result. checkUnordered ( diagnostic: . contains( " the target 'Bar2' in product 'Bar' contains unsafe build flags " ) , behavior: . error)
944
953
}
945
954
}
946
955
0 commit comments