8185436: jtreg: introduce @requires property to disable cds tests
Reviewed-by: jiangli, mseledtsov, iklam
--- a/test/jtreg-ext/requires/VMProps.java Tue Aug 08 21:15:58 2017 +0200
+++ b/test/jtreg-ext/requires/VMProps.java Tue Aug 01 16:03:06 2017 +0200
@@ -71,6 +71,8 @@
map.put("vm.rtm.cpu", vmRTMCPU());
map.put("vm.rtm.os", vmRTMOS());
map.put("vm.aot", vmAOT());
+ // vm.cds is true if the VM is compiled with cds support.
+ map.put("vm.cds", vmCDS());
vmGC(map); // vm.gc.X = true/false
VMProps.dump(map);
@@ -278,6 +280,19 @@
}
/**
+ * Check for CDS support.
+ *
+ * @return true if CDS is supported by the VM to be tested.
+ */
+ protected String vmCDS() {
+ if (WB.isCDSIncludedInVmBuild()) {
+ return "true";
+ } else {
+ return "false";
+ }
+ }
+
+ /**
* Dumps the map to the file if the file name is given as the property.
* This functionality could be helpful to know context in the real
* execution.
--- a/test/lib/sun/hotspot/WhiteBox.java Tue Aug 08 21:15:58 2017 +0200
+++ b/test/lib/sun/hotspot/WhiteBox.java Tue Aug 01 16:03:06 2017 +0200
@@ -523,6 +523,7 @@
public native boolean isShared(Object o);
public native boolean isSharedClass(Class<?> c);
public native boolean areSharedStringsIgnored();
+ public native boolean isCDSIncludedInVmBuild();
// Compiler Directive
public native int addCompilerDirective(String compDirect);