Skip to content

Commit a2d9b2e

Browse files
committed
Make MultiContextCExtTest work when run purely with maven surefire
1 parent f490f69 commit a2d9b2e

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

graalpython/com.oracle.graal.python.test.integration/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,12 @@ Additionally, one can change the polyglot artifacts version with
173173
<scope>runtime</scope>
174174
<type>pom</type>
175175
</dependency>
176+
<dependency>
177+
<!-- See MultiContextCExtTest -->
178+
<groupId>org.graalvm.python</groupId>
179+
<artifactId>python-launcher</artifactId>
180+
<version>${com.oracle.graal.python.test.polyglot.version}</version>
181+
</dependency>
176182
<dependency>
177183
<groupId>org.graalvm.python</groupId>
178184
<artifactId>python-embedding</artifactId>

graalpython/com.oracle.graal.python.test.integration/src/org/graalvm/python/embedding/utils/test/integration/MultiContextCExtTest.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
import java.io.IOException;
5151
import java.nio.file.Files;
5252
import java.nio.file.Path;
53+
import java.util.ArrayList;
5354
import java.util.Arrays;
5455
import java.util.Comparator;
5556
import java.util.Set;
@@ -140,7 +141,17 @@ private static void deleteDirOnShutdown(Path tmpdir) {
140141
}
141142

142143
private static Set<String> getClasspath() {
143-
return Set.copyOf(Arrays.stream((System.getProperty("jdk.module.path") + File.pathSeparator + System.getProperty("java.class.path")).split(File.pathSeparator)).toList());
144+
var sb = new ArrayList<String>();
145+
var modPath = System.getProperty("jdk.module.path");
146+
if (modPath != null) {
147+
sb.add(modPath);
148+
}
149+
var classPath = System.getProperty("java.class.path");
150+
if (classPath != null) {
151+
sb.add(classPath);
152+
}
153+
var cp = String.join(File.pathSeparator, sb);
154+
return Set.copyOf(Arrays.stream(cp.split(File.pathSeparator)).toList());
144155
}
145156

146157
@Test

mx.graalpython/suite.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,6 +1254,7 @@
12541254
"distDependencies": [
12551255
"GRAALPYTHON",
12561256
"GRAALPYTHON_RESOURCES",
1257+
"GRAALPYTHON-LAUNCHER", # See MultiContextCExtTest
12571258
"GRAALPYTHON_EMBEDDING",
12581259
"GRAALPYTHON_EMBEDDING_TOOLS",
12591260
"sulong:SULONG_NATIVE", # See MultiContextTest#testSharingWithStruct

0 commit comments

Comments
 (0)