@@ -2267,6 +2267,12 @@ final class PackageCommandTests: CommandsTestCase {
2267
2267
let containsRemark = StringPattern . contains ( " command plugin: Diagnostics.remark " )
2268
2268
let containsWarning = StringPattern . contains ( " command plugin: Diagnostics.warning " )
2269
2269
let containsError = StringPattern . contains ( " command plugin: Diagnostics.error " )
2270
+ let hiddenLibSwiftScanWarnPattern = StringPattern . equal (
2271
+ """
2272
+ warning: 'miscellaneous_plugins_commandpluginteststub': warning: Unable to locate libSwiftScan. Fallback to `swift-frontend` dependency scanner invocation.
2273
+ warning: Unable to locate libSwiftScan. Fallback to `swift-frontend` dependency scanner invocation.
2274
+ warning: Unable to locate libSwiftScan. Fallback to `swift-frontend` dependency scanner invocation.
2275
+ """ )
2270
2276
2271
2277
try await fixture ( name: " Miscellaneous/Plugins/CommandPluginTestStub " ) { fixturePath in
2272
2278
func runPlugin( flags: [ String ] , diagnostics: [ String ] , completion: ( String , String ) -> Void ) async throws {
@@ -2290,7 +2296,7 @@ final class PackageCommandTests: CommandsTestCase {
2290
2296
2291
2297
try await runPlugin ( flags: [ ] , diagnostics: [ " print " ] ) { stdout, stderr in
2292
2298
XCTAssertMatch ( stdout, isOnlyPrint)
2293
- XCTAssertMatch ( stderr, isEmpty )
2299
+ XCTAssertMatch ( stderr, hiddenLibSwiftScanWarnPattern )
2294
2300
}
2295
2301
2296
2302
try await runPlugin ( flags: [ ] , diagnostics: [ " print " , " progress " ] ) { stdout, stderr in
@@ -2322,7 +2328,7 @@ final class PackageCommandTests: CommandsTestCase {
2322
2328
2323
2329
try await runPlugin ( flags: [ " -q " ] , diagnostics: [ " print " ] ) { stdout, stderr in
2324
2330
XCTAssertMatch ( stdout, isOnlyPrint)
2325
- XCTAssertMatch ( stderr, isEmpty )
2331
+ XCTAssertMatch ( stderr, hiddenLibSwiftScanWarnPattern )
2326
2332
}
2327
2333
2328
2334
try await runPlugin ( flags: [ " -q " ] , diagnostics: [ " print " , " progress " ] ) { stdout, stderr in
@@ -2461,7 +2467,7 @@ final class PackageCommandTests: CommandsTestCase {
2461
2467
let containsLogtext = StringPattern . contains ( " command plugin: packageManager.build logtext: Building for debugging... " )
2462
2468
2463
2469
// Echoed logs have no prefix
2464
- let containsLogecho = StringPattern . regex ( " ^ Building for debugging...\n " )
2470
+ let containsLogecho = StringPattern . contains ( " Building for debugging... \n " )
2465
2471
2466
2472
// These tests involve building a target, so each test must run with a fresh copy of the fixture
2467
2473
// otherwise the logs may be different in subsequent tests.
@@ -2470,14 +2476,14 @@ final class PackageCommandTests: CommandsTestCase {
2470
2476
try await fixture ( name: " Miscellaneous/Plugins/CommandPluginTestStub " ) { fixturePath in
2471
2477
let ( stdout, stderr) = try await SwiftPM . Package. execute ( [ " print-diagnostics " , " build " ] , packagePath: fixturePath, env: [ " SWIFT_DRIVER_SWIFTSCAN_LIB " : " /this/is/a/bad/path " ] )
2472
2478
XCTAssertMatch ( stdout, isEmpty)
2473
- XCTAssertMatch ( stderr, isEmpty )
2479
+ XCTAssertMatch ( stderr, hiddenLibSwiftScanWarnPattern )
2474
2480
}
2475
2481
2476
2482
// Check that logs are returned to the plugin when echoLogs is false
2477
2483
try await fixture ( name: " Miscellaneous/Plugins/CommandPluginTestStub " ) { fixturePath in
2478
2484
let ( stdout, stderr) = try await SwiftPM . Package. execute ( [ " print-diagnostics " , " build " , " printlogs " ] , packagePath: fixturePath, env: [ " SWIFT_DRIVER_SWIFTSCAN_LIB " : " /this/is/a/bad/path " ] )
2479
2485
XCTAssertMatch ( stdout, containsLogtext)
2480
- XCTAssertMatch ( stderr, isEmpty )
2486
+ XCTAssertMatch ( stderr, hiddenLibSwiftScanWarnPattern )
2481
2487
}
2482
2488
2483
2489
// Check that logs echoed to the console (on stderr) when echoLogs is true
0 commit comments