@@ -92,6 +92,54 @@ class APIDigesterTests: XCTestCase {
92
92
XCTAssertTrue ( digesterJob. commandLine. contains ( subsequence: [ " -o " , . path( . absolute( projectDirPath. appending ( component: " foo.abi.json " ) ) ) ] ) )
93
93
}
94
94
}
95
+ do {
96
+ try withTemporaryDirectory { path in
97
+ let ofmPath = path. appending ( component: " ofm.json " )
98
+ try localFileSystem. writeFileContents ( ofmPath) {
99
+ $0 <<< """
100
+ {
101
+ " " : {
102
+ " abi-baseline-json " : " /path/to/baseline.abi.json "
103
+ }
104
+ }
105
+ """
106
+ }
107
+ var driver = try Driver ( args: [ " swiftc " , " -wmo " , " -emit-module " ,
108
+ " -emit-module-interface " , " -enable-library-evolution " ,
109
+ path. appending ( component: " foo.swift " ) . pathString,
110
+ " -emit-digester-baseline " ,
111
+ " -digester-mode " , " abi " ,
112
+ " -o " , path. appending ( component: " foo.swiftmodule " ) . pathString,
113
+ " -output-file-map " , ofmPath. pathString,
114
+ ] )
115
+ let digesterJob = try XCTUnwrap ( driver. planBuild ( ) . first { $0. kind == . generateABIBaseline } )
116
+ XCTAssertTrue ( digesterJob. commandLine. contains ( subsequence: [ " -o " , . path( . absolute( . init( " /path/to/baseline.abi.json " ) ) ) ] ) )
117
+ }
118
+ }
119
+ do {
120
+ try withTemporaryDirectory { path in
121
+ let ofmPath = path. appending ( component: " ofm.json " )
122
+ try localFileSystem. writeFileContents ( ofmPath) {
123
+ $0 <<< """
124
+ {
125
+ " " : {
126
+ " swiftsourceinfo " : " /path/to/sourceinfo "
127
+ }
128
+ }
129
+ """
130
+ }
131
+ var driver = try Driver ( args: [ " swiftc " , " -wmo " , " -emit-module " ,
132
+ " -emit-module-interface " , " -enable-library-evolution " ,
133
+ path. appending ( component: " foo.swift " ) . pathString,
134
+ " -emit-digester-baseline " ,
135
+ " -digester-mode " , " abi " ,
136
+ " -o " , path. appending ( component: " foo.swiftmodule " ) . pathString,
137
+ " -output-file-map " , ofmPath. pathString,
138
+ ] )
139
+ let digesterJob = try XCTUnwrap ( driver. planBuild ( ) . first { $0. kind == . generateABIBaseline } )
140
+ XCTAssertTrue ( digesterJob. commandLine. contains ( subsequence: [ " -o " , . path( . absolute( . init( " /path/to/sourceinfo.abi.json " ) ) ) ] ) )
141
+ }
142
+ }
95
143
}
96
144
97
145
func testBaselineGenerationJobFlags( ) throws {
0 commit comments