@@ -25,6 +25,35 @@ import Testing
2525 . enabled( if: Acceptance . simulatorEnabled)
2626)
2727struct XcodePerTestProfilingFailClosedAcceptanceTests {
28+ @Test ( " The unavailable fast profiler falls back to the serial reference profiler " )
29+ func unavailableFastProfilerFallsBackToSerialReferenceProfiler( ) async throws {
30+ let workspace = try Acceptance . stageFixture ( " XcodeProject " )
31+ defer { try ? FileManager . default. removeItem ( at: workspace) }
32+
33+ let destination = try Acceptance . iPhoneDestination ( )
34+ let configuration = Configuration (
35+ project: ProjectSettings ( kind: . xcodeProject, scheme: " Checkout " , destination: destination)
36+ )
37+ let adapter = XcodeBuildAdapter (
38+ configuration: configuration,
39+ kind: . xcodeProject,
40+ projectFile: nil ,
41+ projectRoot: workspace
42+ )
43+
44+ let artifact = try await adapter. buildBaseline ( in: workspace)
45+ let baseline = try await adapter. runBaseline ( artifact, in: workspace, timeoutSeconds: 120 )
46+ #expect( baseline. status == . passed, " the Checkout baseline must produce the serial profiler's test bundle " )
47+ let profile = try #require(
48+ await adapter. measurePerTestCoverage ( artifact: artifact, in: workspace, timeoutSeconds: 120 ) ,
49+ " the serial reference profiler produced no attribution "
50+ )
51+ #expect(
52+ profile. source == " xcodebuild-xccov-per-test " ,
53+ " the public profiler did not return the serial reference profiler's result "
54+ )
55+ }
56+
2857 @Test ( " An unmeasurable test invalidates the whole per-test coverage map, not just its own entry " )
2958 func unmeasurableTestProducesNoUsableMap( ) async throws {
3059 let workspace = try Acceptance . stageFixture ( " XcodeProject " )
0 commit comments