Skip to content

Commit 3b9c787

Browse files
committed
8208655: use JTreg skipped status in hotspot tests
8023735: [TESTBUG][macosx] runtime/XCheckJniJsig/XCheckJSig.java fails on MacOS X 8208701: Fix for JDK-8208655 causes test failures in CI tier1 8208706: compiler/tiered/ConstantGettersTransitionsTest.java fails to compile 8186095: upgrade to jtreg 4.2 b08 8183503: Update hotspot tests to allow for unique test classes directory 8213410: UseCompressedOops requirement check fails fails on 32-bit system Reviewed-by: stuefe, sgehwolf Backport-of: 17b730d7edf7be91ee841180ea6a59b26c0c567a
1 parent 0464401 commit 3b9c787

35 files changed

+271
-165
lines changed

hotspot/test/ProblemList.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
runtime/SharedArchiveFile/SharedBaseAddress.java 8044600 solaris-sparc
4444
runtime/6929067/Test6929067.sh 8028740 generic-all
4545
runtime/CDSCompressedKPtrs/XShareAuto.java 8026154 generic-all
46-
runtime/XCheckJniJsig/XCheckJSig.java 8023735 generic-all
4746
runtime/6626217/Test6626217.sh 8028733 generic-all
4847
runtime/jsig/Test8017498.sh 8028806 generic-all
4948
runtime/LoadClass/LoadClassNegative.java 8028095 generic-all

hotspot/test/TEST.ROOT

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ groups=TEST.groups [closed/TEST.groups]
3636
requires.extraPropDefns = ../../test/jtreg-ext/requires/VMProps.java
3737
requires.properties=sun.arch.data.model \
3838
vm.flavor \
39-
vm.bits
39+
vm.bits \
40+
vm.debug
41+
42+
# Minimum jtreg version
43+
requiredVersion=4.2 b13
4044

4145
# Path to libraries in the topmost test directory. This is needed so @library
4246
# does not need ../../ notation to reach them

hotspot/test/compiler/classUnloading/anonymousClass/TestAnonymousClassUnloading.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ static private void makeSureIsCompiled(Method m) {
107107
*/
108108
static public void main(String[] args) throws Exception {
109109
// (1) Load an anonymous version of this class using the corresponding Unsafe method
110-
URL classUrl = TestAnonymousClassUnloading.class.getResource("TestAnonymousClassUnloading.class");
110+
String rn = TestAnonymousClassUnloading.class.getSimpleName() + ".class";
111+
URL classUrl = TestAnonymousClassUnloading.class.getResource(rn);
111112
URLConnection connection = classUrl.openConnection();
112113

113114
int length = connection.getContentLength();

hotspot/test/compiler/tiered/ConstantGettersTransitionsTest.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2014, 2018, 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
@@ -21,12 +21,14 @@
2121
* questions.
2222
*/
2323

24+
import jtreg.SkippedException;
25+
2426
import java.lang.reflect.Executable;
2527
import java.util.concurrent.Callable;
2628

2729
/**
2830
* @test ConstantGettersTransitionsTest
29-
* @library /testlibrary /testlibrary/whitebox /compiler/whitebox
31+
* @library /testlibrary /testlibrary/whitebox /compiler/whitebox /test/lib
3032
* @build TransitionsTestExecutor ConstantGettersTransitionsTest
3133
* @run main ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission
3234
* @run main/othervm/timeout=240 -Xmixed -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
@@ -37,7 +39,9 @@
3739
*/
3840
public class ConstantGettersTransitionsTest extends LevelTransitionTest {
3941
public static void main(String[] args) {
40-
assert (!CompilerWhiteBoxTest.skipOnTieredCompilation(false));
42+
if (CompilerWhiteBoxTest.skipOnTieredCompilation(false)) {
43+
throw new SkippedException("Test isn't applicable for non-tiered mode");
44+
}
4145

4246
// run test cases
4347
for (TestCase testCase : ConstantGettersTestCase.values()) {

hotspot/test/compiler/tiered/LevelTransitionTest.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,16 @@
2121
* questions.
2222
*/
2323

24+
import jtreg.SkippedException;
25+
2426
import java.lang.reflect.Executable;
2527
import java.lang.reflect.Method;
2628
import java.util.Objects;
2729
import java.util.concurrent.Callable;
2830

2931
/**
3032
* @test LevelTransitionTest
31-
* @library /testlibrary /testlibrary/whitebox /compiler/whitebox
33+
* @library /testlibrary /testlibrary/whitebox /compiler/whitebox /test/lib
3234
* @build TransitionsTestExecutor LevelTransitionTest
3335
* @run main ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission
3436
* @run main/othervm/timeout=240 -Xmixed -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
@@ -44,7 +46,9 @@ public class LevelTransitionTest extends TieredLevelsTest {
4446
private int transitionCount;
4547

4648
public static void main(String[] args) throws Throwable {
47-
assert (!CompilerWhiteBoxTest.skipOnTieredCompilation(false));
49+
if (CompilerWhiteBoxTest.skipOnTieredCompilation(false)) {
50+
throw new SkippedException("Test isn't applicable for non-tiered mode");
51+
}
4852

4953
CompilerWhiteBoxTest.main(LevelTransitionTest::new, args);
5054
// run extended test cases

hotspot/test/compiler/tiered/NonTieredLevelsTest.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2013, 2018, 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
@@ -22,10 +22,11 @@
2222
*/
2323

2424
import java.util.function.IntPredicate;
25+
import jtreg.SkippedException;
2526

2627
/**
2728
* @test NonTieredLevelsTest
28-
* @library /testlibrary /testlibrary/whitebox /compiler/whitebox
29+
* @library /testlibrary /testlibrary/whitebox /compiler/whitebox /test/lib
2930
* @build NonTieredLevelsTest
3031
* @run main ClassFileInstaller sun.hotspot.WhiteBox
3132
* @run main/othervm -Xbootclasspath/a:. -XX:-TieredCompilation
@@ -54,7 +55,7 @@ public class NonTieredLevelsTest extends CompLevelsTest {
5455
}
5556
public static void main(String[] args) throws Exception {
5657
if (CompilerWhiteBoxTest.skipOnTieredCompilation(true)) {
57-
return;
58+
throw new SkippedException("Test isn't applicable for tiered mode");
5859
}
5960
CompilerWhiteBoxTest.main(NonTieredLevelsTest::new, args);
6061
}

hotspot/test/compiler/tiered/TieredLevelsTest.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2013, 2018, 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
@@ -23,7 +23,7 @@
2323

2424
/**
2525
* @test TieredLevelsTest
26-
* @library /testlibrary /testlibrary/whitebox /compiler/whitebox
26+
* @library /testlibrary /testlibrary/whitebox /compiler/whitebox /test/lib
2727
* @build TieredLevelsTest
2828
* @run main ClassFileInstaller sun.hotspot.WhiteBox
2929
* @run main/othervm -Xbootclasspath/a:. -XX:+TieredCompilation
@@ -33,10 +33,13 @@
3333
* @summary Verify that all levels < 'TieredStopAtLevel' can be used
3434
* @author igor.ignatyev@oracle.com
3535
*/
36+
37+
import jtreg.SkippedException;
38+
3639
public class TieredLevelsTest extends CompLevelsTest {
3740
public static void main(String[] args) throws Exception, Throwable {
3841
if (CompilerWhiteBoxTest.skipOnTieredCompilation(false)) {
39-
return;
42+
throw new SkippedException("Test isn't applicable for non-tiered mode");
4043
}
4144
CompilerWhiteBoxTest.main(TieredLevelsTest::new, args);
4245
}

hotspot/test/gc/arguments/TestAggressiveHeap.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 2018, 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
@@ -26,7 +26,7 @@
2626
* @key gc
2727
* @bug 8179084
2828
* @summary Test argument processing for -XX:+AggressiveHeap.
29-
* @library /testlibrary
29+
* @library /testlibrary /test/lib
3030
* @run driver TestAggressiveHeap
3131
*/
3232

@@ -36,6 +36,7 @@
3636

3737
import com.oracle.java.testlibrary.OutputAnalyzer;
3838
import com.oracle.java.testlibrary.ProcessTools;
39+
import jtreg.SkippedException;
3940

4041
public class TestAggressiveHeap {
4142

@@ -86,9 +87,7 @@ private static boolean haveRequiredMemory() throws Exception {
8687

8788
private static boolean canUseAggressiveHeapOption() throws Exception {
8889
if (!haveRequiredMemory()) {
89-
System.out.println(
90-
"Skipping test of " + option + " : insufficient memory");
91-
return false;
90+
throw new SkippedException("Skipping test of " + option + " : insufficient memory");
9291
}
9392
return true;
9493
}

hotspot/test/gc/g1/TestHumongousShrinkHeap.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2014, 2018, 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,7 +27,7 @@
2727
* @requires vm.gc=="G1" | vm.gc=="null"
2828
* @summary Verify that heap shrinks after GC in the presence of fragmentation
2929
* due to humongous objects
30-
* @library /testlibrary
30+
* @library /testlibrary /test/lib
3131
* @run main/othervm -XX:-ExplicitGCInvokesConcurrent -XX:MinHeapFreeRatio=10
3232
* -XX:MaxHeapFreeRatio=12 -XX:+UseG1GC -XX:G1HeapRegionSize=1M -verbose:gc
3333
* TestHumongousShrinkHeap
@@ -39,6 +39,7 @@
3939
import java.util.List;
4040
import sun.management.ManagementFactoryHelper;
4141
import static com.oracle.java.testlibrary.Asserts.*;
42+
import jtreg.SkippedException;
4243

4344
public class TestHumongousShrinkHeap {
4445

@@ -57,13 +58,11 @@ public class TestHumongousShrinkHeap {
5758

5859
public static void main(String[] args) {
5960
if (HUMON_COUNT == 0) {
60-
System.out.println("Skipped. Heap is too small");
61-
return;
61+
throw new SkippedException("Heap is too small");
6262
}
6363

6464
if (TOTAL_MEMORY + REGION_SIZE * HUMON_COUNT > MAX_MEMORY) {
65-
System.out.println("Skipped. Initial heap size is to close to max heap size.");
66-
return;
65+
throw new SkippedException("Initial heap size is to close to max heap size.");
6766
}
6867

6968
System.out.format("Running with %s initial heap size of %s maximum heap size. "

hotspot/test/gc/g1/TestLargePageUseForAuxMemory.java

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2015, 2018, 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
@@ -25,8 +25,8 @@
2525
* @test TestLargePageUseForAuxMemory.java
2626
* @bug 8058354
2727
* @key gc
28-
* @library /testlibrary /testlibrary/whitebox
29-
* @requires (vm.gc=="G1" | vm.gc=="null")
28+
* @library /testlibrary /testlibrary/whitebox /test/lib
29+
* @requires (vm.gc=="G1" | vm.gc=="null") & vm.debug
3030
* @build TestLargePageUseForAuxMemory
3131
* @run main ClassFileInstaller sun.hotspot.WhiteBox
3232
* sun.hotspot.WhiteBox$WhiteBoxPermission
@@ -35,6 +35,7 @@
3535
*/
3636

3737
import com.oracle.java.testlibrary.*;
38+
import jtreg.SkippedException;
3839
import sun.hotspot.WhiteBox;
3940

4041
public class TestLargePageUseForAuxMemory {
@@ -88,18 +89,12 @@ static void testVM(long heapsize, boolean cardsShouldUseLargePages, boolean bitm
8889
}
8990

9091
public static void main(String[] args) throws Exception {
91-
if (!Platform.isDebugBuild()) {
92-
System.out.println("Skip tests on non-debug builds because the required option TracePageSizes is a debug-only option.");
93-
return;
94-
}
95-
9692
WhiteBox wb = WhiteBox.getWhiteBox();
9793
smallPageSize = wb.getVMPageSize();
9894
largePageSize = wb.getVMLargePageSize();
9995

10096
if (largePageSize == 0) {
101-
System.out.println("Skip tests because large page support does not seem to be available on this platform.");
102-
return;
97+
throw new SkippedException("Large page support does not seem to be available on this platform.");
10398
}
10499

105100
// To get large pages for the card table etc. we need at least a 1G heap (with 4k page size).

0 commit comments

Comments
 (0)