From 85d8ace8c21ece1d7220087e05007eb1cf8559e2 Mon Sep 17 00:00:00 2001 From: Owen Voorhees Date: Mon, 20 Oct 2025 14:47:31 -0700 Subject: [PATCH] Make assembleSingleFile resilient to output changes rdar://161996868 --- Tests/SWBBuildSystemTests/BuildCommandTests.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Tests/SWBBuildSystemTests/BuildCommandTests.swift b/Tests/SWBBuildSystemTests/BuildCommandTests.swift index 91ecb6da..72bd036e 100644 --- a/Tests/SWBBuildSystemTests/BuildCommandTests.swift +++ b/Tests/SWBBuildSystemTests/BuildCommandTests.swift @@ -220,7 +220,7 @@ fileprivate struct BuildCommandTests: CoreBasedTests { task.checkCommandLineContainsUninterrupted(["-x", "objective-c"]) try task.checkCommandLineContainsUninterrupted(["-S", #require(inputs.first).str, "-o", #require(outputs.first)]) let assembly = try String(contentsOfFile: #require(outputs.first), encoding: .utf8) - #expect(assembly.hasPrefix("\t.section\t__TEXT,__text,regular,pure_instructions")) + #expect(assembly.contains("\t.section\t__TEXT,__text,regular,pure_instructions")) } results.checkNoTask() } @@ -232,7 +232,7 @@ fileprivate struct BuildCommandTests: CoreBasedTests { task.checkCommandLineContainsUninterrupted(["-x", "objective-c"]) try task.checkCommandLineContainsUninterrupted(["-S", #require(inputs.first).str, "-o", #require(outputs.first)]) let assembly = try String(contentsOfFile: #require(outputs.first), encoding: .utf8) - #expect(assembly.hasPrefix("\t.section\t__TEXT,__text,regular,pure_instructions")) + #expect(assembly.contains("\t.section\t__TEXT,__text,regular,pure_instructions")) } results.checkNoTask() } @@ -246,13 +246,13 @@ fileprivate struct BuildCommandTests: CoreBasedTests { task.checkCommandLineContainsUninterrupted(["-x", "objective-c"]) try task.checkCommandLineContainsUninterrupted(["-S", #require(inputs.first).str, "-o", firstOutput]) let assembly = try String(contentsOfFile: firstOutput, encoding: .utf8) - #expect(assembly.hasPrefix("\t.section\t__TEXT,__text,regular,pure_instructions")) + #expect(assembly.contains("\t.section\t__TEXT,__text,regular,pure_instructions")) } try results.checkTask(.matchRuleType("Assemble"), .matchRuleItemBasename("File.m"), .matchRuleItem("normal"), .matchRuleItem(results.runDestinationTargetArchitecture), .matchTargetName("bFramework")) { task in task.checkCommandLineContainsUninterrupted(["-x", "objective-c"]) try task.checkCommandLineContainsUninterrupted(["-S", #require(inputs.first).str, "-o", secondOutput]) let assembly = try String(contentsOfFile: secondOutput, encoding: .utf8) - #expect(assembly.hasPrefix("\t.section\t__TEXT,__text,regular,pure_instructions")) + #expect(assembly.contains("\t.section\t__TEXT,__text,regular,pure_instructions")) } results.checkNoTask() results.checkNoErrors()