8185436: jtreg: introduce @requires property to disable cds tests

Fix CompressedClassPointers test to succeed also if cds is not available.

Reviewed-by: jiangli, mseledtsov, iklam
This commit is contained in:
Goetz Lindenmaier 2017-08-03 10:24:34 +02:00
parent b37c8b6587
commit 7635d5162e
30 changed files with 78 additions and 38 deletions

View File

@ -1700,6 +1700,14 @@ WB_ENTRY(jboolean, WB_AreSharedStringsIgnored(JNIEnv* env))
return StringTable::shared_string_ignored();
WB_END
WB_ENTRY(jboolean, WB_IsCDSIncludedInVmBuild(JNIEnv* env))
#if INCLUDE_CDS
return true;
#else
return false;
#endif
WB_END
//Some convenience methods to deal with objects from java
int WhiteBox::offset_for_field(const char* field_name, oop object,
Symbol* signature_symbol) {
@ -1993,6 +2001,7 @@ static JNINativeMethod methods[] = {
{CC"isShared", CC"(Ljava/lang/Object;)Z", (void*)&WB_IsShared },
{CC"isSharedClass", CC"(Ljava/lang/Class;)Z", (void*)&WB_IsSharedClass },
{CC"areSharedStringsIgnored", CC"()Z", (void*)&WB_AreSharedStringsIgnored },
{CC"isCDSIncludedInVmBuild", CC"()Z", (void*)&WB_IsCDSIncludedInVmBuild },
{CC"clearInlineCaches0", CC"(Z)V", (void*)&WB_ClearInlineCaches },
{CC"addCompilerDirective", CC"(Ljava/lang/String;)I",
(void*)&WB_AddCompilerDirective },

View File

@ -51,7 +51,8 @@ requires.properties= \
vm.debug \
vm.rtm.cpu \
vm.rtm.os \
vm.aot
vm.aot \
vm.cds
# Tests using jtreg 4.2 b07 features
requiredVersion=4.2 b07

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -21,13 +21,13 @@
* questions.
*/
/*
/**
* @test
* @bug 8169703
* @summary Verifies that dumping and loading a CDS archive succeeds with AlwaysPreTouch
* @requires vm.gc.G1
* @key gc
* @key regression
* @key gc regression
* @requires vm.cds
* @library /test/lib
* @modules java.base/jdk.internal.misc
* java.management

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -21,8 +21,9 @@
* questions.
*/
/*
/**
* @test
* @requires vm.cds
* @bug 8003424
* @summary Testing UseCompressedClassPointers with CDS
* @library /test/lib

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -21,8 +21,9 @@
* questions.
*/
/*
/**
* @test
* @requires vm.cds
* @bug 8003424
* @summary Test that cannot use CDS if UseCompressedClassPointers is turned off.
* @library /test/lib

View File

@ -21,8 +21,9 @@
* questions.
*/
/*
/**
* @test
* @requires vm.cds
* @bug 8005933
* @summary Test that -Xshare:auto uses CDS when explicitly specified with -server.
* @library /test/lib

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -106,6 +106,9 @@ public class CompressedClassPointers {
"-XX:+VerifyBeforeGC",
"-Xshare:dump");
OutputAnalyzer output = new OutputAnalyzer(pb.start());
if (output.firstMatch("Shared spaces are not supported in this VM") != null) {
return;
}
try {
output.shouldContain("Loading classes to share");
output.shouldHaveExitValue(0);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -21,15 +21,17 @@
* questions.
*/
/*
/**
* @test
* @bug 8055061
* @key nmt
* @requires vm.cds
* @library /test/lib
* @modules java.base/jdk.internal.misc
* java.management
* @run main NMTWithCDS
*/
import jdk.test.lib.process.ProcessTools;
import jdk.test.lib.process.OutputAnalyzer;

View File

@ -21,8 +21,9 @@
* questions.
*/
/*
/**
* @test ArchiveDoesNotExist
* @requires vm.cds
* @summary Test how VM handles "file does not exist" situation while
* attempting to use CDS archive. JVM should exit gracefully
* when sharing mode is ON, and continue w/o sharing if sharing

View File

@ -23,6 +23,7 @@
/**
* @test
* @requires vm.cds
* @summary Testing -Xbootclasspath/a support for CDS
* @requires (vm.opt.UseCompressedOops == null) | (vm.opt.UseCompressedOops == true)
* @library /test/lib

View File

@ -21,8 +21,9 @@
* questions.
*/
/*
/**
* @test CdsDifferentCompactStrings
* @requires vm.cds
* @summary CDS (class data sharing) requires the same -XX:[+-]CompactStrings
* setting between archive creation time and load time.
* @requires (vm.opt.UseCompressedOops == null) | (vm.opt.UseCompressedOops == true)

View File

@ -21,8 +21,9 @@
* questions.
*/
/*
/**
* @test CdsDifferentObjectAlignment
* @requires vm.cds
* @summary Testing CDS (class data sharing) using varying object alignment.
* Using different object alignment for each dump/load pair.
* This is a negative test; using object alignment for loading that

View File

@ -21,8 +21,9 @@
* questions.
*/
/*
/**
* @test CdsSameObjectAlignment
* @requires vm.cds
* @summary Testing CDS (class data sharing) using varying object alignment.
* Using same object alignment for each dump/load pair
* @requires (vm.opt.UseCompressedOops == null) | (vm.opt.UseCompressedOops == true)

View File

@ -26,6 +26,7 @@
* @bug 8130072
* @summary Check that Shared Dictionary is printed out with jcmd
* Feature support: compressed oops/kptrs, 64-bit os, not on windows
* @requires vm.cds
* @requires (sun.arch.data.model != "32") & (os.family != "windows")
* @requires (vm.opt.UseCompressedOops == null) | (vm.opt.UseCompressedOops == true)
* @library /test/lib

View File

@ -21,8 +21,9 @@
* questions.
*/
/*
/**
* @test
* @requires vm.cds
* @bug 8067187
* @summary Testing CDS dumping with the -XX:MaxMetaspaceSize=<size> option
* @library /test/lib

View File

@ -21,8 +21,9 @@
* questions.
*/
/*
/**
* @test
* @requires vm.cds
* @bug 8066670
* @summary Testing -XX:+PrintSharedArchiveAndExit option
* @requires (vm.opt.UseCompressedOops == null) | (vm.opt.UseCompressedOops == true)

View File

@ -21,8 +21,9 @@
* questions.
*/
/*
/**
* @test SASymbolTableTest
* @requires vm.cds
* @summary Walk symbol table using SA, with and without CDS.
* @requires (vm.opt.UseCompressedOops == null) | (vm.opt.UseCompressedOops == true)
* @library /test/lib

View File

@ -21,8 +21,9 @@
* questions.
*/
/*
/**
* @test
* @requires vm.cds
* @bug 8014138
* @summary Testing new -XX:SharedArchiveFile=<file-name> option
* @requires (vm.opt.UseCompressedOops == null) | (vm.opt.UseCompressedOops == true)

View File

@ -21,8 +21,9 @@
* questions.
*/
/*
/**
* @test SharedBaseAddress
* @requires vm.cds
* @summary Test variety of values for SharedBaseAddress, making sure
* VM handles normal values as well as edge values w/o a crash.
* @requires (vm.opt.UseCompressedOops == null) | (vm.opt.UseCompressedOops == true)

View File

@ -21,8 +21,9 @@
* questions.
*/
/*
/**
* @test
* @requires vm.cds
* @summary Check to make sure that shared strings in the bootstrap CDS archive
* are actually shared
* Feature support: G1GC only, compressed oops/kptrs, 64-bit os, not on windows

View File

@ -21,8 +21,9 @@
* questions.
*/
/*
/**
* @test SharedStringsDedup
* @requires vm.cds
* @summary Test -Xshare:auto with shared strings and -XX:+UseStringDeduplication
* Feature support: G1GC only, compressed oops/kptrs, 64-bit os, not on windows
* @requires (sun.arch.data.model != "32") & (os.family != "windows")

View File

@ -21,8 +21,9 @@
* questions.
*/
/*
/**
* @test SharedStringsAuto
* @requires vm.cds
* @summary Test -Xshare:auto with shared strings.
* Feature support: G1GC only, compressed oops/kptrs, 64-bit os, not on windows
* @requires (sun.arch.data.model != "32") & (os.family != "windows")

View File

@ -21,8 +21,9 @@
* questions.
*/
/*
/**
* @test
* @requires vm.cds
* @bug 8059510
* @summary Test SharedSymbolTableBucketSize option
* @requires (vm.opt.UseCompressedOops == null) | (vm.opt.UseCompressedOops == true)

View File

@ -21,8 +21,9 @@
* questions.
*/
/*
/**
* @test SpaceUtilizationCheck
* @requires vm.cds
* @summary Check if the space utilization for shared spaces is adequate
* @requires (vm.opt.UseCompressedOops == null) | (vm.opt.UseCompressedOops == true)
* @library /test/lib

View File

@ -21,8 +21,9 @@
* questions.
*/
/*
/**
* @test InterpreterMethodEntries
* @requires vm.cds
* @bug 8169711
* @summary Test interpreter method entries for intrinsics with CDS (class data sharing)
* and different settings of the intrinsic flag during dump/use of the archive.

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -21,8 +21,9 @@
* questions.
*/
/*
/**
* @test
* @requires vm.cds
* @summary Exercise initial transformation (ClassFileLoadHook)
* with CDS with Interface/Implementor pair
* @library /test/lib /runtime/SharedArchiveFile /testlibrary/jvmti

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -22,8 +22,9 @@
*/
/*
/**
* @test
* @requires vm.cds
* @summary Exercise initial transformation (ClassFileLoadHook)
* with CDS with SubClass and SuperClass
* @library /test/lib /runtime/SharedArchiveFile /testlibrary/jvmti

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -22,8 +22,9 @@
*/
/*
/**
* @test
* @requires vm.cds
* @summary Exercise initial transformation (ClassFileLoadHook)
* with CDS with SubClass and SuperClass, each lives in own separate package
* @library /test/lib /runtime/SharedArchiveFile /testlibrary/jvmti

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -21,8 +21,9 @@
* questions.
*/
/*
/**
* @test
* @requires vm.cds
* @summary test that --patch-module works with CDS
* @library /test/lib
* @modules java.base/jdk.internal.misc

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -21,8 +21,9 @@
* questions.
*/
/*
/**
* @test
* @requires vm.cds
* @summary classes which are not useable during run time should not be included in the classlist
* @library /test/lib
* @modules java.base/jdk.internal.misc