Skip to content

Commit b744311

Browse files
authored
[Test] Fix color mismatch on UI Compacibility test case (#689)
1 parent 37596d3 commit b744311

File tree

8 files changed

+49
-7
lines changed

8 files changed

+49
-7
lines changed

Example/OpenSwiftUIUITests/Animation/Animation/AnimationCompletionUITests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ struct AnimationCompletionUITests {
4747
}
4848
// When run seperately, precision: 1.0 works fine
4949
// but in the full suite, it will hit the same issue of #340
50-
withKnownIssue("#340", isIntermittent: true) {
50+
withKnownIssue("#690", isIntermittent: true) {
5151
openSwiftUIAssertAnimationSnapshot(
5252
of: ContentView()
5353
)

Example/OpenSwiftUIUITests/Animation/Animation/BezierAnimationUITests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ struct BezierAnimationUITests {
7777
}
7878
// When run seperately, precision: 1.0 works fine
7979
// but in the full suite, it will hit the same issue of #340
80-
withKnownIssue("$340", isIntermittent: true) {
80+
withKnownIssue("$690", isIntermittent: true) {
8181
openSwiftUIAssertAnimationSnapshot(
8282
of: ContentView(),
8383
)

Example/OpenSwiftUIUITests/Animation/Animation/RepeatAnimationUITests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ struct RepeatAnimationUITests {
3131
}
3232
}
3333
}
34-
withKnownIssue("#340", isIntermittent: true) {
34+
withKnownIssue("#690", isIntermittent: true) {
3535
openSwiftUIAssertAnimationSnapshot(
3636
of: ContentView(autoreverses: autoreverses),
3737
testName: #function + "\(autoreverses)"

Example/OpenSwiftUIUITests/Graphic/Color/ColorUITests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ struct ColorUITests {
7575
}
7676
}
7777
}
78-
withKnownIssue("#340", isIntermittent: true) {
78+
withKnownIssue("#690", isIntermittent: true) {
7979
openSwiftUIAssertAnimationSnapshot(of: ContentView())
8080
}
8181
}

Example/OpenSwiftUIUITests/Layout/Stack/ZStackUITests.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,7 @@ struct ZStackUITests {
8787
}
8888
}
8989
openSwiftUIAssertSnapshot(
90-
of: ContentView(),
91-
// FIXME: Workaround #340
92-
perceptualPrecision: 0.99
90+
of: ContentView()
9391
)
9492
}
9593
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//
2+
// Initialize.c
3+
// OpenSwiftUIUITests
4+
//
5+
// Created by Kyle on 12/29/25.
6+
//
7+
8+
#include "Initialize.h"
9+
#include <stdio.h>
10+
11+
extern void OpenSwiftUIUITests_InitializeSwift(void);
12+
13+
static void OpenSwiftUIUITests_Initialize(void) {
14+
OpenSwiftUIUITests_InitializeSwift();
15+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
//
2+
// Initialize.h
3+
// OpenSwiftUIUITests
4+
//
5+
// Created by Kyle on 12/29/25.
6+
//
7+
8+
#pragma once
9+
10+
__attribute__((constructor, used))
11+
static void OpenSwiftUIUITests_Initialize(void);
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//
2+
// Initialize.swift
3+
// OpenSwiftUIUITests
4+
//
5+
// Created by Kyle on 12/29/25.
6+
//
7+
8+
#if OPENSWIFTUI
9+
@_spi(ForTestOnly)
10+
import OpenSwiftUI
11+
#endif
12+
13+
@_cdecl("OpenSwiftUIUITests_InitializeSwift")
14+
func __initialize() -> () {
15+
#if OPENSWIFTUI
16+
Color.Resolved._alignWithSwiftUIImplementation = true
17+
#endif
18+
}

0 commit comments

Comments
 (0)