Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, 2026, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* The Universal Permissive License (UPL), Version 1.0
Expand Down Expand Up @@ -47,6 +47,7 @@

public class Utils {
public static final boolean IS_WINDOWS = System.getProperty("os.name").toLowerCase(Locale.ROOT).contains("windows");
public static final boolean SUPPORTS_PANAMA = Runtime.version().feature() >= 22;

public static String getThreadDump() {
ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
*/
package com.oracle.graal.python.test.integration.advanced;

import static com.oracle.graal.python.test.integration.Utils.SUPPORTS_PANAMA;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

Expand Down Expand Up @@ -77,7 +78,7 @@ Stream<Thread> pythonThreads() {
@Test
public void testNoNewThreadsWithoutAutomaticAsyncActions() {
Assume.assumeTrue("false".equalsIgnoreCase(System.getProperty("python.AutomaticAsyncActions")));
Assume.assumeTrue("Requires JEP 454 support for _testcapi", Runtime.version().feature() >= 22);
Assume.assumeTrue("Requires JEP 454 support for _testcapi", SUPPORTS_PANAMA);
long threadCount = pythonThreadCount();
Context c = PythonTests.enterContext(Map.of("python.AllowSignalHandlers", "true", "python.PosixModuleBackend", "native"), new String[0]);
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
*/
package com.oracle.graal.python.test.integration.advanced;

import static com.oracle.graal.python.test.integration.Utils.SUPPORTS_PANAMA;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
Expand All @@ -64,7 +66,7 @@ public class NativeExtTest {
@BeforeClass
public static void setUpClass() {
Assume.assumeFalse(System.getProperty("os.name").toLowerCase().contains("mac"));
Assume.assumeTrue(Runtime.version().feature() >= 22);
Assume.assumeTrue(SUPPORTS_PANAMA);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
*/
package com.oracle.graal.python.test.integration.advanced;

import static com.oracle.graal.python.test.integration.Utils.SUPPORTS_PANAMA;

import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
Expand All @@ -59,7 +61,7 @@ public class ShutdownTest extends PythonTests {
@BeforeClass
public static void setUpClass() {
Assume.assumeFalse(System.getProperty("os.name").toLowerCase().contains("mac"));
Assume.assumeTrue(Runtime.version().feature() >= 22);
Assume.assumeTrue(SUPPORTS_PANAMA);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
package com.oracle.graal.python.cext.test;

import static com.oracle.graal.python.cext.test.MultithreadedImportTestBase.multithreadedImportTest;
import static com.oracle.graal.python.test.integration.Utils.SUPPORTS_PANAMA;

import org.graalvm.polyglot.Context;
import org.junit.Assume;
Expand All @@ -50,7 +51,7 @@
public class MultithreadedImportTestJava {
@BeforeClass
public static void setUpClass() {
Assume.assumeTrue(Runtime.version().feature() >= 22);
Assume.assumeTrue(SUPPORTS_PANAMA);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
*/
package com.oracle.graal.python.cext.test;

import static com.oracle.graal.python.test.integration.Utils.SUPPORTS_PANAMA;

import org.graalvm.polyglot.Context;
import org.junit.Assume;
import org.junit.BeforeClass;
Expand All @@ -48,7 +50,7 @@
public class MultithreadedImportTestNative extends MultithreadedImportTestBase {
@BeforeClass
public static void setUpClass() {
Assume.assumeTrue(Runtime.version().feature() >= 22);
Assume.assumeTrue(SUPPORTS_PANAMA);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
import static com.oracle.graal.python.runtime.PosixConstants.SO_TYPE;
import static com.oracle.graal.python.runtime.PosixConstants.TCP_NODELAY;
import static com.oracle.graal.python.runtime.PosixConstants.TCP_USER_TIMEOUT;
import static com.oracle.graal.python.test.integration.Utils.SUPPORTS_PANAMA;
import static com.oracle.graal.python.util.PythonUtils.toTruffleStringUncached;
import static org.hamcrest.CoreMatchers.anyOf;
import static org.hamcrest.CoreMatchers.equalTo;
Expand Down Expand Up @@ -142,7 +143,7 @@ public class SocketTests {

@Parameters(name = "{0}")
public static String[] params() {
return new String[]{"native", "java"};
return SUPPORTS_PANAMA ? new String[]{"java", "native"} : new String[]{"java"};
}

@Rule public WithPythonContextRule withPythonContextRule = new WithPythonContextRule((o) -> o.put("python.PosixModuleBackend", backendName));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2026, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* The Universal Permissive License (UPL), Version 1.0
Expand Down Expand Up @@ -42,6 +42,7 @@

import static com.oracle.graal.python.test.PythonTests.ts;
import static com.oracle.graal.python.test.integration.Utils.IS_WINDOWS;
import static com.oracle.graal.python.test.integration.Utils.SUPPORTS_PANAMA;
import static com.oracle.graal.python.util.PythonUtils.TS_ENCODING;

import java.math.BigInteger;
Expand Down Expand Up @@ -83,7 +84,7 @@ public class PathConversionNodeTests extends ConversionNodeTests {

@Parameters(name = "{0}")
public static String[] params() {
return new String[]{"java", "native"};
return SUPPORTS_PANAMA ? new String[]{"java", "native"} : new String[]{"java"};
}

@Before
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
*/
package com.oracle.graal.python.test.builtin.objects;

import static com.oracle.graal.python.test.integration.Utils.SUPPORTS_PANAMA;

import java.util.EnumSet;

import org.junit.After;
Expand All @@ -65,7 +67,7 @@ public class TpSlotsTests {

@BeforeClass
public static void setUpClass() {
Assume.assumeTrue(Runtime.version().feature() >= 22);
Assume.assumeTrue(SUPPORTS_PANAMA);
}

@Before
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
*/
package com.oracle.graal.python.test.builtin.objects.cext;

import static com.oracle.graal.python.test.integration.Utils.SUPPORTS_PANAMA;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.instanceOf;
import static org.hamcrest.CoreMatchers.not;
Expand Down Expand Up @@ -72,7 +73,7 @@ public class SlotWrapperTests {
@BeforeClass
public static void setUpClass() {
Assume.assumeFalse(System.getProperty("os.name").toLowerCase().contains("mac"));
Assume.assumeTrue(Runtime.version().feature() >= 22);
Assume.assumeTrue(SUPPORTS_PANAMA);
}

@Before
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
*/
package com.oracle.graal.python.test.nodes;

import static com.oracle.graal.python.test.integration.Utils.SUPPORTS_PANAMA;

import com.oracle.graal.python.builtins.objects.PNone;
import com.oracle.graal.python.builtins.objects.cext.capi.CApiContext;
import com.oracle.graal.python.builtins.objects.common.SequenceStorageNodes.MemMoveNode;
Expand Down Expand Up @@ -68,7 +70,7 @@ public class MemMoveNodeTests {
@BeforeClass
public static void setUpClass() {
Assume.assumeFalse(System.getProperty("os.name").toLowerCase().contains("mac"));
Assume.assumeTrue(Runtime.version().feature() >= 22);
Assume.assumeTrue(SUPPORTS_PANAMA);
}

@Before
Expand Down
Loading