From 1a7bd791d07180cf3a6ec9b21fcc6008d5eefc8b Mon Sep 17 00:00:00 2001 From: Shai Almog <67850168+shai-almog@users.noreply.github.com> Date: Fri, 17 Jul 2026 06:55:22 +0300 Subject: [PATCH] Separate JavaSE reference probes from port compliance --- scripts/hellocodenameone/README.adoc | 9 ++++--- .../tests/Cn1ssDeviceRunner.java | 27 ++++++++++++++++--- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/scripts/hellocodenameone/README.adoc b/scripts/hellocodenameone/README.adoc index b5390b5a829..caaea701d8a 100644 --- a/scripts/hellocodenameone/README.adoc +++ b/scripts/hellocodenameone/README.adoc @@ -72,9 +72,12 @@ Renderer variants and CPU architectures intentionally remain separate so a regression cannot be hidden by a combined platform result. The feature contract lives in -`docs/website/data/port_status.json`. Every test registered in -`Cn1ssDeviceRunner`, including tests installed through `addTest()`, must appear -under exactly one feature. Every committed CN1SS golden filename must map back +`docs/website/data/port_status.json`. Every test in +`Cn1ssDeviceRunner.DEFAULT_TEST_CLASSES`, and every test installed through +`addTest()`, must appear under exactly one feature. JavaSE-only visual reference +probes live separately in `JAVASE_REFERENCE_TEST_CLASSES`: they remain available +to filtered simulator runs but are not portability tests and do not appear on +the public Port Status page. Every committed CN1SS golden filename must map back to its producing test. Validate both rules from the repository root: [source,shell] diff --git a/scripts/hellocodenameone/common/src/main/java/com/codenameone/examples/hellocodenameone/tests/Cn1ssDeviceRunner.java b/scripts/hellocodenameone/common/src/main/java/com/codenameone/examples/hellocodenameone/tests/Cn1ssDeviceRunner.java index 5a2ec9ef7ba..cdc5fb28b20 100644 --- a/scripts/hellocodenameone/common/src/main/java/com/codenameone/examples/hellocodenameone/tests/Cn1ssDeviceRunner.java +++ b/scripts/hellocodenameone/common/src/main/java/com/codenameone/examples/hellocodenameone/tests/Cn1ssDeviceRunner.java @@ -154,7 +154,6 @@ private static int testTimeoutMs(BaseTest testClass) { new MorphTransitionScrubScreenshotTest(), new MorphElementMorphScreenshotTest(), new TabsAnimatedIndicatorScreenshotTest(), - new TabsLiquidGlassAnimationScreenshotTest(), new PullToRefreshSpinnerScreenshotTest(), new AnimateLayoutScreenshotTest(), new AnimateHierarchyScreenshotTest(), @@ -439,6 +438,14 @@ private static int testTimeoutMs(BaseTest testClass) { new VideoIORoundTripTest() }; + // Visual probes used to compare the simulator renderer with native + // reference captures are not portability tests. Keep them available to a + // filtered JavaSE run without adding always-skipped rows to the public + // cross-port compliance contract. + private static final BaseTest[] JAVASE_REFERENCE_TEST_CLASSES = new BaseTest[]{ + new TabsLiquidGlassAnimationScreenshotTest() + }; + private static BaseTest prependedTest; /// Index of the test that has consumed its one-shot silent-timeout retry @@ -465,12 +472,26 @@ public void runSuite() { private void runNextTest(int index) { int offset = prependedTest != null ? 1 : 0; - int total = DEFAULT_TEST_CLASSES.length + offset; + boolean includeJavaSeReferences = "SE".equals( + Display.getInstance().getProperty("OS", "")); + int referenceCount = includeJavaSeReferences + ? JAVASE_REFERENCE_TEST_CLASSES.length + : 0; + int total = DEFAULT_TEST_CLASSES.length + referenceCount + offset; if (index >= total) { finishSuite(); return; } - BaseTest testClass = (offset == 1 && index == 0) ? prependedTest : DEFAULT_TEST_CLASSES[index - offset]; + BaseTest testClass; + int suiteIndex = index - offset; + if (offset == 1 && index == 0) { + testClass = prependedTest; + } else if (suiteIndex < DEFAULT_TEST_CLASSES.length) { + testClass = DEFAULT_TEST_CLASSES[suiteIndex]; + } else { + testClass = JAVASE_REFERENCE_TEST_CLASSES[ + suiteIndex - DEFAULT_TEST_CLASSES.length]; + } String testName = testClass.getClass().getSimpleName(); if (!matchesFilter(testName)) { // Optional subset run: -Dcn1ss.filter= or CN1SS_FILTER=