Skip to content

Commit d601189

Browse files
committed
Add todo JUnit5 tags to GTK4 and wayland tests that need work still
Issue #2714 is to get tests running on GTK4 and wayland. One challenge is that some tests are known failures because work has not been completed in some narrow areas. Rather than add `assumeFalse(GTK4)` which would disable the tests all the time, this PR marks the tests that are still to be done with `@Tag` so that we can update the CI to exclude these tests until someone has had a chance to review them more fully. A subsequent commit will exclude these tagged tests on GitHub actions, unless a suitable label is set on the PR. Part of #2714
1 parent 43bb7f2 commit d601189

10 files changed

+44
-0
lines changed

tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug336238_ShellSetBoundFailTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@
1717
import static org.junit.jupiter.api.Assertions.assertEquals;
1818

1919
import org.eclipse.swt.widgets.Shell;
20+
import org.junit.jupiter.api.Tag;
2021
import org.junit.jupiter.api.Test;
2122

2223
public class Bug336238_ShellSetBoundFailTest {
2324

2425
static int cycles = 100;
2526

27+
@Tag("gtk4-todo")
2628
@Test
2729
public void testSetBounds() {
2830

tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_Browser.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@
8585
import org.junit.jupiter.api.BeforeEach;
8686
import org.junit.jupiter.api.Disabled;
8787
import org.junit.jupiter.api.MethodOrderer;
88+
import org.junit.jupiter.api.Tag;
8889
import org.junit.jupiter.api.Test;
8990
import org.junit.jupiter.api.TestInfo;
9091
import org.junit.jupiter.api.TestMethodOrder;
@@ -418,6 +419,7 @@ public void test_evalute_Cookies () {
418419
assertFalse(res.isEmpty());
419420
}
420421

422+
@Tag("gtk4-todo")
421423
@Test
422424
public void test_ClearAllSessionCookies () {
423425
final AtomicBoolean loaded = new AtomicBoolean(false);
@@ -447,6 +449,7 @@ public void test_ClearAllSessionCookies () {
447449
assertTrue(e2 == null || e2.isEmpty());
448450
}
449451

452+
@Tag("gtk4-todo")
450453
@Test
451454
public void test_get_set_Cookies() {
452455
final AtomicBoolean loaded = new AtomicBoolean(false);
@@ -806,6 +809,7 @@ public void test_OpenWindowListener_addAndRemove() {
806809
for (int i = 0; i < 100; i++) browser.removeOpenWindowListener(listener);
807810
}
808811

812+
@Tag("gtk4-todo")
809813
@Test
810814
public void test_OpenWindowListener_openHasValidEventDetails() {
811815
AtomicBoolean openFiredCorrectly = new AtomicBoolean(false);
@@ -828,6 +832,7 @@ public void test_OpenWindowListener_openHasValidEventDetails() {
828832
}
829833

830834
/** Test that a script 'window.open()' opens a child popup shell. */
835+
@Tag("gtk4-todo")
831836
@Test
832837
public void test_OpenWindowListener_open_ChildPopup() {
833838
AtomicBoolean childCompleted = new AtomicBoolean(false);
@@ -865,6 +870,7 @@ public void test_OpenWindowListener_open_ChildPopup() {
865870
}
866871

867872
/** Validate event order : Child's visibility should come before progress completed event */
873+
@Tag("gtk4-todo")
868874
@Test
869875
public void test_OpenWindow_Progress_Listener_ValidateEventOrder() {
870876

@@ -1032,6 +1038,7 @@ public void test_StatusTextListener_addAndRemove() {
10321038
* over the hyperlink (newer Webkit2+) browser.
10331039
*/
10341040
@Test
1041+
@Tag("gtk4-todo")
10351042
public void test_StatusTextListener_hoverMouseOverLink() {
10361043
assumeFalse(isEdge, "no API in Edge for this");
10371044

@@ -1304,6 +1311,7 @@ public void show(WindowEvent event) {
13041311
}
13051312

13061313
/** Verify that if multiple child shells are open, no duplicate visibility events are sent. */
1314+
@Tag("gtk4-todo")
13071315
@Test
13081316
public void test_VisibilityWindowListener_multiple_shells() {
13091317
AtomicBoolean secondChildCompleted = new AtomicBoolean(false);
@@ -1364,6 +1372,7 @@ public void completed(ProgressEvent event) {
13641372
* Validate that when javascript opens a new window and specifies size,
13651373
* it's size is passed to the visibility event correctly.
13661374
*/
1375+
@Tag("gtk4-todo")
13671376
@Test
13681377
public void test_VisibilityWindowListener_eventSize() {
13691378

tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyledText.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,6 +1166,7 @@ public void test_getLineHeight() {
11661166
assertTrue(text.getLineHeight() > 0);
11671167
}
11681168

1169+
@Tag("gtk4-todo")
11691170
@Test
11701171
public void test_getLineIndex () {
11711172
test_getLineIndex(text);
@@ -1252,6 +1253,7 @@ void test_getLineIndex (StyledText text) {
12521253
assertEquals(0, text.getLineIndex(100));
12531254
}
12541255

1256+
@Tag("gtk4-todo")
12551257
@Test
12561258
public void test_getLinePixel () {
12571259
test_getLinePixel(text);
@@ -5394,6 +5396,7 @@ public void test_insertInBlockSelection() {
53945396
+ System.lineSeparator()));
53955397
}
53965398

5399+
@Tag("gtk4-todo")
53975400
@Test
53985401
public void test_setStyleRanges_render() throws InterruptedException {
53995402
assumeFalse(SwtTestUtil.isCocoa, "Bug 553090 prevents test to work on Mac");
@@ -5424,6 +5427,7 @@ public void test_setStyleRanges_render() throws InterruptedException {
54245427
/**
54255428
* Test LineStyleListener which provides styles but no ranges.
54265429
*/
5430+
@Tag("gtk4-todo")
54275431
@Test
54285432
public void test_lineStyleListener_styles_render() throws InterruptedException {
54295433
assumeFalse(SwtTestUtil.isCocoa, "Bug 536588 prevents test to work on Mac");
@@ -5449,6 +5453,7 @@ public void test_lineStyleListener_styles_render() throws InterruptedException {
54495453
/**
54505454
* Test LineStyleListener which provides styles and ranges.
54515455
*/
5456+
@Tag("gtk4-todo")
54525457
@Test
54535458
public void test_lineStyleListener_stylesAndRanges_render() throws InterruptedException {
54545459
assumeFalse(SwtTestUtil.isCocoa, "Bug 536588 prevents test to work on Mac");
@@ -5475,6 +5480,7 @@ public void test_lineStyleListener_stylesAndRanges_render() throws InterruptedEx
54755480
/**
54765481
* Test LineStyleListener which provides invalid styles with invalid start or length.
54775482
*/
5483+
@Tag("gtk4-todo")
54785484
@Test
54795485
public void test_lineStyleListener_invalidStyles_render() throws InterruptedException {
54805486
assumeFalse(SwtTestUtil.isCocoa, "Bug 536588 prevents test to work on Mac");
@@ -5658,6 +5664,7 @@ public void test_consistency_DragDetect () {
56585664
* Such a problem was once caused with bug 547532 and discovered along bug 549110.
56595665
* </p>
56605666
*/
5667+
@Tag("gtk4-todo")
56615668
@Test
56625669
public void test_GlyphMetricsOnTab_Bug549110() throws InterruptedException {
56635670
assumeFalse(SwtTestUtil.isCocoa, "Bug 536588 prevents test to work on Mac");
@@ -5732,6 +5739,7 @@ public void test_InsertWhenDisabled() {
57325739
* Bug 551335 - [StyledText] setStyleRanges reset less cache than necessary
57335740
* Bug 551336 - [StyledText] resetting styles does not reset rendering
57345741
*/
5742+
@Tag("gtk4-todo")
57355743
@Test
57365744
public void test_bug551335_lostStyles() throws InterruptedException {
57375745
assumeFalse(SwtTestUtil.isCocoa, "Bug 536588 prevents test to work on Mac");
@@ -5904,6 +5912,7 @@ public void test_arrowDownKeepsPositionAfterNewLine() {
59045912
* Bug 565164 - SWT.BS event no longer working
59055913
*/
59065914
@Test
5915+
@Tag("gtk4-todo")
59075916
public void test_backspaceAndDelete() throws InterruptedException {
59085917
assumeTrue(Boolean.parseBoolean(System.getenv("GITHUB_ACTIONS")),
59095918
"Display.post tests only run successfully on GitHub actions - see https://github.com/eclipse-platform/eclipse.platform.swt/issues/2571");

tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_dnd_ByteArrayTransfer.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ public void test_nativeToJava() throws Exception {
196196

197197
@Order(1)
198198
@Test
199+
@Tag("gtk4-todo")
199200
@DisabledOnOs(value = OS.MAC, disabledReason = """
200201
remote.getMyTypeContents doesn't work properly on macOS, this is
201202
probably a test only issue on macOS

tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Composite.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import org.eclipse.swt.widgets.Text;
3232
import org.eclipse.swt.widgets.Widget;
3333
import org.junit.jupiter.api.BeforeEach;
34+
import org.junit.jupiter.api.Tag;
3435
import org.junit.jupiter.api.Test;
3536

3637

@@ -120,6 +121,7 @@ public void test_setVisibility_and_sizing() {
120121
}
121122

122123
@Test
124+
@Tag("gtk4-wayland-todo")
123125
public void test_setFocus_toChild_afterOpen() {
124126
if (SwtTestUtil.isCocoa) {
125127
//TODO Fix Cocoa failure.
@@ -135,6 +137,7 @@ public void test_setFocus_toChild_afterOpen() {
135137
}
136138

137139
@Test
140+
@Tag("gtk4-wayland-todo")
138141
public void test_setFocus_toChild_beforeOpen() {
139142
if (SwtTestUtil.isCocoa) {
140143
//TODO Fix Cocoa failure.
@@ -150,6 +153,7 @@ public void test_setFocus_toChild_beforeOpen() {
150153
}
151154

152155
@Test
156+
@Tag("gtk4-wayland-todo")
153157
public void test_setFocus_withInvisibleChild() {
154158
final AtomicReference<Boolean> wasSetFocusCalledOnInvisibleChildWidget = new AtomicReference<>(false);
155159
Composite invisibleChildWidget = new Composite(composite, SWT.NONE) {
@@ -167,6 +171,7 @@ public boolean setFocus() {
167171
}
168172

169173
@Test
174+
@Tag("gtk4-wayland-todo")
170175
public void test_setFocus_withVisibleAndInvisibleChild() {
171176
final AtomicReference<Boolean> wasSetFocusCalledOnInvisibleChildWidget = new AtomicReference<>(false);
172177
Composite invisibleChildWidget = new Composite(composite, SWT.NONE) {

tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Control.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
import org.eclipse.swt.widgets.Monitor;
6060
import org.eclipse.swt.widgets.Shell;
6161
import org.eclipse.swt.widgets.Widget;
62+
import org.junit.jupiter.api.Tag;
6263
import org.junit.jupiter.api.Test;
6364

6465
/**
@@ -521,6 +522,7 @@ public void test_isEnabled() {
521522
assertFalse(control.isEnabled());
522523
}
523524
@Test
525+
@Tag("gtk4-wayland-todo")
524526
public void test_isFocusControl() {
525527
if (shell.getVisible()) {
526528
// Some tests, such as `Test_org_eclipse_swt_widgets_Text`, show their

tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Display.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
import org.eclipse.swt.widgets.Shell;
4747
import org.eclipse.swt.widgets.Synchronizer;
4848
import org.eclipse.test.Screenshots;
49+
import org.junit.jupiter.api.Tag;
4950
import org.junit.jupiter.api.Test;
5051
import org.junit.jupiter.api.TestInfo;
5152
import org.junit.jupiter.api.condition.DisabledOnOs;
@@ -332,6 +333,7 @@ public void test_getCursorControl() {
332333
}
333334
}
334335

336+
@Tag("gtk4-todo")
335337
@Test
336338
public void test_getCursorLocation() {
337339
Display display = new Display();
@@ -1041,6 +1043,8 @@ public void test_mapLorg_eclipse_swt_widgets_ControlLorg_eclipse_swt_widgets_Con
10411043

10421044
@Test
10431045
@EnabledIfEnvironmentVariable(named = "GITHUB_ACTIONS", matches = "true", disabledReason = "Display.post tests only run successfully on GitHub actions - see https://github.com/eclipse-platform/eclipse.platform.swt/issues/2571")
1046+
@Tag("gtk4-todo")
1047+
@Tag("gtk3-wayland-todo")
10441048
public void test_postLorg_eclipse_swt_widgets_Event() {
10451049
final int KEYCODE = SWT.SHIFT;
10461050

@@ -1201,6 +1205,7 @@ public void test_setAppNameLjava_lang_String() {
12011205
Display.setAppName("My Application Name");
12021206
}
12031207

1208+
@Tag("gtk4-todo")
12041209
@Test
12051210
public void test_setCursorLocationII(TestInfo info) {
12061211
Display display = new Display();
@@ -1227,6 +1232,7 @@ public void test_setCursorLocationII(TestInfo info) {
12271232
}
12281233
}
12291234

1235+
@Tag("gtk4-todo")
12301236
@Test
12311237
public void test_setCursorLocationLorg_eclipse_swt_graphics_Point(TestInfo info) {
12321238
Display display = new Display();
@@ -1332,6 +1338,7 @@ protected void asyncExec (Runnable runnable) {
13321338
}
13331339
}
13341340

1341+
@Tag("gtk4-todo")
13351342
@Test
13361343
public void test_sleep() {
13371344
final Display display = new Display();

tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_MenuItem.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import org.eclipse.swt.widgets.Menu;
3030
import org.eclipse.swt.widgets.MenuItem;
3131
import org.junit.jupiter.api.BeforeEach;
32+
import org.junit.jupiter.api.Tag;
3233
import org.junit.jupiter.api.Test;
3334

3435
/**
@@ -194,6 +195,7 @@ public void test_setEnabledZ() {
194195
assertFalse(menuItem.getEnabled());
195196
}
196197

198+
@Tag("gtk4-todo")
197199
@Override
198200
@Test
199201
public void test_setImageLorg_eclipse_swt_graphics_Image() {

tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Shell.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
import org.eclipse.swt.widgets.Shell;
4646
import org.eclipse.swt.widgets.Text;
4747
import org.junit.jupiter.api.BeforeEach;
48+
import org.junit.jupiter.api.Tag;
4849
import org.junit.jupiter.api.Test;
4950

5051
/**
@@ -654,6 +655,7 @@ public void test_setBoundsLorg_eclipse_swt_graphics_Rectangle() {
654655
* Regression test for Bug 436841 - [GTK3] FocusOut/In and Activate/Deactivate
655656
* events when opening context menu. Only applicable on GTK x11.
656657
*/
658+
@Tag("gtk4-todo")
657659
@Test
658660
public void test_activateEventSend() throws InterruptedException {
659661
assumeTrue((SwtTestUtil.isGTK && SwtTestUtil.isX11()) || SwtTestUtil.isGTK4(),
@@ -706,6 +708,7 @@ public void test_activateEventSend() throws InterruptedException {
706708
*
707709
* Disabled on Wayland as there is no absolute positioning.
708710
*/
711+
@Tag("gtk4-todo")
709712
@Test
710713
public void test_setBounds() throws Exception {
711714
if (SwtTestUtil.isX11()) {
@@ -957,6 +960,7 @@ public void test_bug558652_scrollBarNPE() {
957960
}
958961
}
959962

963+
@Tag("gtk4-todo")
960964
@Test
961965
public void test_Issue450_NoShellActivateOnSetFocus() {
962966
final String key = "org.eclipse.swt.internal.activateShellOnForceFocus";

tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Text.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,6 +1102,7 @@ public void test_setEditableZ() {
11021102
assertTrue(text.getEditable());
11031103
}
11041104

1105+
@Tag("gtk4-todo")
11051106
@Override
11061107
@Test
11071108
public void test_setFontLorg_eclipse_swt_graphics_Font() {
@@ -1443,6 +1444,7 @@ public void test_consistency_DragDetect () {
14431444
consistencyEvent(30, 10, 50, 0, ConsistencyUtility.MOUSE_DRAG);
14441445
}
14451446

1447+
@Tag("gtk4-todo")
14461448
@Tag("clipboard")
14471449
@Test
14481450
public void test_consistency_Segments () {
@@ -1566,6 +1568,7 @@ private void doSegmentsTest (boolean isListening) {
15661568
* Bug 565164 - SWT.BS event no longer working
15671569
*/
15681570
@Test
1571+
@Tag("gtk4-todo")
15691572
public void test_backspaceAndDelete() throws InterruptedException {
15701573
assumeTrue(Boolean.parseBoolean(System.getenv("GITHUB_ACTIONS")),
15711574
"Display.post tests only run successfully on GitHub actions - see https://github.com/eclipse-platform/eclipse.platform.swt/issues/2571");

0 commit comments

Comments
 (0)