Skip to content

Commit 53824cf

Browse files
committed
8343809: Add requires tag to mark tests that are incompatible with exploded image
Reviewed-by: alanb, dholmes
1 parent 2daf12e commit 53824cf

File tree

5 files changed

+22
-2
lines changed

5 files changed

+22
-2
lines changed

test/hotspot/jtreg/TEST.ROOT

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ requires.properties= \
101101
container.support \
102102
systemd.support \
103103
jdk.containerized \
104+
jdk.explodedImage \
104105
jlink.runtime.linkable \
105106
jlink.packagedModules \
106107
jdk.static

test/hotspot/jtreg/runtime/getSysPackage/GetSysPkgTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,7 @@
2727
* @modules java.base/jdk.internal.loader
2828
* java.logging
2929
* @requires vm.flagless
30+
* @requires !jdk.explodedImage
3031
* @library /test/lib
3132
* @run driver GetSysPkgTest
3233
*/

test/hotspot/jtreg/runtime/modules/ModulesSymLink.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/*
2+
* Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved.
23
* Copyright (c) 2019, Google Inc. All rights reserved.
34
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
45
*
@@ -27,6 +28,7 @@
2728
* @bug 8220095
2829
* @requires os.family == "linux" | os.family == "mac"
2930
* @requires vm.flagless
31+
* @requires !jdk.explodedImage
3032
* @requires !jdk.static
3133
* @library /test/lib
3234
* @modules java.management

test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTraceCL.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,7 @@
2727
* @summary Make sure -Xlog:class+load=info works properly with "modules" jimage,
2828
--patch-module, and with -Xbootclasspath/a
2929
* @requires vm.flagless
30+
* @requires !jdk.explodedImage
3031
* @modules java.base/jdk.internal.misc
3132
* @library /test/lib
3233
* @compile PatchModuleMain.java

test/jtreg-ext/requires/VMProps.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ public Map<String, String> call() {
146146
map.put("jdk.containerized", this::jdkContainerized);
147147
map.put("vm.flagless", this::isFlagless);
148148
map.put("jdk.foreign.linker", this::jdkForeignLinker);
149+
map.put("jdk.explodedImage", this::explodedImage);
149150
map.put("jlink.packagedModules", this::packagedModules);
150151
map.put("jdk.static", this::isStatic);
151152
vmGC(map); // vm.gc.X = true/false
@@ -751,6 +752,20 @@ private String jdkContainerized() {
751752
return "" + "true".equalsIgnoreCase(isEnabled);
752753
}
753754

755+
private String explodedImage() {
756+
try {
757+
Path jmodFile = Path.of(System.getProperty("java.home"), "jmods", "java.base.jmod");
758+
if (Files.exists(jmodFile)) {
759+
return Boolean.FALSE.toString();
760+
} else {
761+
return Boolean.TRUE.toString();
762+
}
763+
} catch (Throwable t) {
764+
t.printStackTrace();
765+
return errorWithMessage("Error in explodedImage " + t);
766+
}
767+
}
768+
754769
private String packagedModules() {
755770
// Some jlink tests require packaged modules being present (jmods).
756771
// For a runtime linkable image build packaged modules aren't present

0 commit comments

Comments
 (0)