hotspot/test/runtime/CommandLine/OptionsValidation/TestOptionsWithRanges.java
author alanb
Thu, 17 Mar 2016 19:04:01 +0000
changeset 36508 5f9eee6b383b
parent 36189 2fbe2434b914
child 36616 5172e3dd60f2
permissions -rw-r--r--
8142968: Module System implementation Summary: Initial integration of JEP 200, JEP 260, JEP 261, and JEP 282 Reviewed-by: acorn, ccheung, coleenp, ctornqvi, dholmes, dsimms, gtriantafill, iklam, jiangli, mgronlun, mseledtsov, cjplummer, sspitsyn, stefank, twisti, hseigel, lfoltan, alanb, mchung, dfazunen Contributed-by: alan.bateman@oracle.com, alex.buckley@oracle.com, jonathan.gibbons@oracle.com, karen.kinnear@oracle.com, mandy.chung@oracle.com, mark.reinhold@oracle.com, harold.seigel@oracle.com, lois.foltan@oracle.com, calvin.cheung@oracle.com, christian.tornqvist@oracle.com, erik.joelsson@oracle.com, george.triantafillou@oracle.com, igor.ignatyev@oracle.com, ioi.lam@oracle.com, james.laskey@oracle.com, jean-francois.denise@oracle.com, jiangli.zhou@oracle.com, markus.gronlund@oracle.com, serguei.spitsyn@oracle.com, staffan.larsen@oracle.com, sundararajan.athijegannathan@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
31372
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
     1
/*
36175
0f5b32ce95fc 8144578: TestOptionsWithRanges test only ever uses the default collector
ddmitriev
parents: 35462
diff changeset
     2
 * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
31372
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
     4
 *
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
     7
 * published by the Free Software Foundation.
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
     8
 *
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
    13
 * accompanied this code).
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
    14
 *
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
    18
 *
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
    21
 * questions.
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
    22
 */
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
    23
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
    24
/*
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
    25
 * @test
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
    26
 * @summary Test VM Options with ranges
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
    27
 * @library /testlibrary /runtime/CommandLine/OptionsValidation/common
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
    28
 * @modules java.base/sun.misc
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
    29
 *          java.management
36508
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36189
diff changeset
    30
 *          jdk.attach/sun.tools.attach
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36189
diff changeset
    31
 *          jdk.jvmstat/sun.jvmstat.monitor
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36189
diff changeset
    32
 * @build jdk.test.lib.* TestOptionsWithRanges
34661
9a1d11d88ea0 8142341: GC: current flags need ranges to be implemented
sangheki
parents: 34317
diff changeset
    33
 * @run main/othervm/timeout=900 TestOptionsWithRanges
31372
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
    34
 */
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
    35
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
    36
import java.util.ArrayList;
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
    37
import java.util.List;
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
    38
import java.util.Map;
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
    39
import jdk.test.lib.Asserts;
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
    40
import optionsvalidation.JVMOption;
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
    41
import optionsvalidation.JVMOptionsUtils;
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
    42
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
    43
public class TestOptionsWithRanges {
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
    44
34275
9b1771bfd6cf 8143038: [TESTBUG] TestOptionsWithRanges: allow excluding only a subset of tested values specified for a flag
ddmitriev
parents: 34242
diff changeset
    45
    private static Map<String, JVMOption> allOptionsAsMap;
9b1771bfd6cf 8143038: [TESTBUG] TestOptionsWithRanges: allow excluding only a subset of tested values specified for a flag
ddmitriev
parents: 34242
diff changeset
    46
9b1771bfd6cf 8143038: [TESTBUG] TestOptionsWithRanges: allow excluding only a subset of tested values specified for a flag
ddmitriev
parents: 34242
diff changeset
    47
    private static void excludeTestMaxRange(String optionName) {
9b1771bfd6cf 8143038: [TESTBUG] TestOptionsWithRanges: allow excluding only a subset of tested values specified for a flag
ddmitriev
parents: 34242
diff changeset
    48
        JVMOption option = allOptionsAsMap.get(optionName);
9b1771bfd6cf 8143038: [TESTBUG] TestOptionsWithRanges: allow excluding only a subset of tested values specified for a flag
ddmitriev
parents: 34242
diff changeset
    49
9b1771bfd6cf 8143038: [TESTBUG] TestOptionsWithRanges: allow excluding only a subset of tested values specified for a flag
ddmitriev
parents: 34242
diff changeset
    50
        if (option != null) {
9b1771bfd6cf 8143038: [TESTBUG] TestOptionsWithRanges: allow excluding only a subset of tested values specified for a flag
ddmitriev
parents: 34242
diff changeset
    51
            option.excludeTestMaxRange();
9b1771bfd6cf 8143038: [TESTBUG] TestOptionsWithRanges: allow excluding only a subset of tested values specified for a flag
ddmitriev
parents: 34242
diff changeset
    52
        }
9b1771bfd6cf 8143038: [TESTBUG] TestOptionsWithRanges: allow excluding only a subset of tested values specified for a flag
ddmitriev
parents: 34242
diff changeset
    53
    }
9b1771bfd6cf 8143038: [TESTBUG] TestOptionsWithRanges: allow excluding only a subset of tested values specified for a flag
ddmitriev
parents: 34242
diff changeset
    54
9b1771bfd6cf 8143038: [TESTBUG] TestOptionsWithRanges: allow excluding only a subset of tested values specified for a flag
ddmitriev
parents: 34242
diff changeset
    55
    private static void excludeTestMinRange(String optionName) {
9b1771bfd6cf 8143038: [TESTBUG] TestOptionsWithRanges: allow excluding only a subset of tested values specified for a flag
ddmitriev
parents: 34242
diff changeset
    56
        JVMOption option = allOptionsAsMap.get(optionName);
9b1771bfd6cf 8143038: [TESTBUG] TestOptionsWithRanges: allow excluding only a subset of tested values specified for a flag
ddmitriev
parents: 34242
diff changeset
    57
9b1771bfd6cf 8143038: [TESTBUG] TestOptionsWithRanges: allow excluding only a subset of tested values specified for a flag
ddmitriev
parents: 34242
diff changeset
    58
        if (option != null) {
9b1771bfd6cf 8143038: [TESTBUG] TestOptionsWithRanges: allow excluding only a subset of tested values specified for a flag
ddmitriev
parents: 34242
diff changeset
    59
            option.excludeTestMinRange();
9b1771bfd6cf 8143038: [TESTBUG] TestOptionsWithRanges: allow excluding only a subset of tested values specified for a flag
ddmitriev
parents: 34242
diff changeset
    60
        }
9b1771bfd6cf 8143038: [TESTBUG] TestOptionsWithRanges: allow excluding only a subset of tested values specified for a flag
ddmitriev
parents: 34242
diff changeset
    61
    }
9b1771bfd6cf 8143038: [TESTBUG] TestOptionsWithRanges: allow excluding only a subset of tested values specified for a flag
ddmitriev
parents: 34242
diff changeset
    62
9b1771bfd6cf 8143038: [TESTBUG] TestOptionsWithRanges: allow excluding only a subset of tested values specified for a flag
ddmitriev
parents: 34242
diff changeset
    63
    private static void excludeTestRange(String optionName) {
9b1771bfd6cf 8143038: [TESTBUG] TestOptionsWithRanges: allow excluding only a subset of tested values specified for a flag
ddmitriev
parents: 34242
diff changeset
    64
        allOptionsAsMap.remove(optionName);
9b1771bfd6cf 8143038: [TESTBUG] TestOptionsWithRanges: allow excluding only a subset of tested values specified for a flag
ddmitriev
parents: 34242
diff changeset
    65
    }
9b1771bfd6cf 8143038: [TESTBUG] TestOptionsWithRanges: allow excluding only a subset of tested values specified for a flag
ddmitriev
parents: 34242
diff changeset
    66
35074
4ac430acedd7 8142874: [TESTBUG] OptionsValidation testing framework needs to handle VM error codes in some cases
ddmitriev
parents: 34675
diff changeset
    67
    private static void setAllowedExitCodes(String optionName, Integer... allowedExitCodes) {
4ac430acedd7 8142874: [TESTBUG] OptionsValidation testing framework needs to handle VM error codes in some cases
ddmitriev
parents: 34675
diff changeset
    68
        JVMOption option = allOptionsAsMap.get(optionName);
4ac430acedd7 8142874: [TESTBUG] OptionsValidation testing framework needs to handle VM error codes in some cases
ddmitriev
parents: 34675
diff changeset
    69
4ac430acedd7 8142874: [TESTBUG] OptionsValidation testing framework needs to handle VM error codes in some cases
ddmitriev
parents: 34675
diff changeset
    70
        if (option != null) {
4ac430acedd7 8142874: [TESTBUG] OptionsValidation testing framework needs to handle VM error codes in some cases
ddmitriev
parents: 34675
diff changeset
    71
            option.setAllowedExitCodes(allowedExitCodes);
4ac430acedd7 8142874: [TESTBUG] OptionsValidation testing framework needs to handle VM error codes in some cases
ddmitriev
parents: 34675
diff changeset
    72
        }
4ac430acedd7 8142874: [TESTBUG] OptionsValidation testing framework needs to handle VM error codes in some cases
ddmitriev
parents: 34675
diff changeset
    73
    }
4ac430acedd7 8142874: [TESTBUG] OptionsValidation testing framework needs to handle VM error codes in some cases
ddmitriev
parents: 34675
diff changeset
    74
31372
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
    75
    public static void main(String[] args) throws Exception {
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
    76
        int failedTests;
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
    77
        List<JVMOption> allOptions;
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
    78
36189
2fbe2434b914 8146187: Print develop and nonproduct flags by -XX:+PrintFlags* options in debug build
ddmitriev
parents: 36175
diff changeset
    79
        allOptionsAsMap = JVMOptionsUtils.getOptionsWithRangeAsMap(origin -> (!(origin.contains("develop") || origin.contains("notproduct"))));
34275
9b1771bfd6cf 8143038: [TESTBUG] TestOptionsWithRanges: allow excluding only a subset of tested values specified for a flag
ddmitriev
parents: 34242
diff changeset
    80
35074
4ac430acedd7 8142874: [TESTBUG] OptionsValidation testing framework needs to handle VM error codes in some cases
ddmitriev
parents: 34675
diff changeset
    81
        /* Shared flags can cause JVM to exit with error code 2 */
4ac430acedd7 8142874: [TESTBUG] OptionsValidation testing framework needs to handle VM error codes in some cases
ddmitriev
parents: 34675
diff changeset
    82
        setAllowedExitCodes("SharedReadWriteSize", 2);
4ac430acedd7 8142874: [TESTBUG] OptionsValidation testing framework needs to handle VM error codes in some cases
ddmitriev
parents: 34675
diff changeset
    83
        setAllowedExitCodes("SharedReadOnlySize", 2);
4ac430acedd7 8142874: [TESTBUG] OptionsValidation testing framework needs to handle VM error codes in some cases
ddmitriev
parents: 34675
diff changeset
    84
        setAllowedExitCodes("SharedMiscDataSize", 2);
4ac430acedd7 8142874: [TESTBUG] OptionsValidation testing framework needs to handle VM error codes in some cases
ddmitriev
parents: 34675
diff changeset
    85
        setAllowedExitCodes("SharedMiscCodeSize", 2);
4ac430acedd7 8142874: [TESTBUG] OptionsValidation testing framework needs to handle VM error codes in some cases
ddmitriev
parents: 34675
diff changeset
    86
31372
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
    87
        /*
36175
0f5b32ce95fc 8144578: TestOptionsWithRanges test only ever uses the default collector
ddmitriev
parents: 35462
diff changeset
    88
         * JDK-8145204
0f5b32ce95fc 8144578: TestOptionsWithRanges test only ever uses the default collector
ddmitriev
parents: 35462
diff changeset
    89
         * Temporarily remove testing of max range for ParGCArrayScanChunk because
0f5b32ce95fc 8144578: TestOptionsWithRanges test only ever uses the default collector
ddmitriev
parents: 35462
diff changeset
    90
         * JVM can hang when ParGCArrayScanChunk=4294967296 and ParallelGC is used
0f5b32ce95fc 8144578: TestOptionsWithRanges test only ever uses the default collector
ddmitriev
parents: 35462
diff changeset
    91
         */
0f5b32ce95fc 8144578: TestOptionsWithRanges test only ever uses the default collector
ddmitriev
parents: 35462
diff changeset
    92
        excludeTestMaxRange("ParGCArrayScanChunk");
0f5b32ce95fc 8144578: TestOptionsWithRanges test only ever uses the default collector
ddmitriev
parents: 35462
diff changeset
    93
0f5b32ce95fc 8144578: TestOptionsWithRanges test only ever uses the default collector
ddmitriev
parents: 35462
diff changeset
    94
        /*
31372
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
    95
         * Remove CICompilerCount from testing because currently it can hang system
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
    96
         */
34275
9b1771bfd6cf 8143038: [TESTBUG] TestOptionsWithRanges: allow excluding only a subset of tested values specified for a flag
ddmitriev
parents: 34242
diff changeset
    97
        excludeTestMaxRange("CICompilerCount");
31372
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
    98
33144
c56850e328fc 8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents: 31372
diff changeset
    99
        /*
33222
e0a340f4ab6e 8078556: Runtime: implement ranges (optionally constraints) for those flags that have them missing.
gziemski
parents: 33144
diff changeset
   100
         * JDK-8136766
e0a340f4ab6e 8078556: Runtime: implement ranges (optionally constraints) for those flags that have them missing.
gziemski
parents: 33144
diff changeset
   101
         * Temporarily remove ThreadStackSize from testing because Windows can set it to 0
e0a340f4ab6e 8078556: Runtime: implement ranges (optionally constraints) for those flags that have them missing.
gziemski
parents: 33144
diff changeset
   102
         * (for default OS size) but other platforms insist it must be greater than 0
e0a340f4ab6e 8078556: Runtime: implement ranges (optionally constraints) for those flags that have them missing.
gziemski
parents: 33144
diff changeset
   103
        */
34275
9b1771bfd6cf 8143038: [TESTBUG] TestOptionsWithRanges: allow excluding only a subset of tested values specified for a flag
ddmitriev
parents: 34242
diff changeset
   104
        excludeTestRange("ThreadStackSize");
33222
e0a340f4ab6e 8078556: Runtime: implement ranges (optionally constraints) for those flags that have them missing.
gziemski
parents: 33144
diff changeset
   105
e0a340f4ab6e 8078556: Runtime: implement ranges (optionally constraints) for those flags that have them missing.
gziemski
parents: 33144
diff changeset
   106
        /*
35074
4ac430acedd7 8142874: [TESTBUG] OptionsValidation testing framework needs to handle VM error codes in some cases
ddmitriev
parents: 34675
diff changeset
   107
         * JDK-8143958
4ac430acedd7 8142874: [TESTBUG] OptionsValidation testing framework needs to handle VM error codes in some cases
ddmitriev
parents: 34675
diff changeset
   108
         * Temporarily exclude testing of max range for Shared* flags
34242
e530decd7c63 8138983: Runtime: implement ranges for Shared*** flags
gziemski
parents: 33610
diff changeset
   109
         */
35074
4ac430acedd7 8142874: [TESTBUG] OptionsValidation testing framework needs to handle VM error codes in some cases
ddmitriev
parents: 34675
diff changeset
   110
        excludeTestMaxRange("SharedReadWriteSize");
4ac430acedd7 8142874: [TESTBUG] OptionsValidation testing framework needs to handle VM error codes in some cases
ddmitriev
parents: 34675
diff changeset
   111
        excludeTestMaxRange("SharedReadOnlySize");
4ac430acedd7 8142874: [TESTBUG] OptionsValidation testing framework needs to handle VM error codes in some cases
ddmitriev
parents: 34675
diff changeset
   112
        excludeTestMaxRange("SharedMiscDataSize");
4ac430acedd7 8142874: [TESTBUG] OptionsValidation testing framework needs to handle VM error codes in some cases
ddmitriev
parents: 34675
diff changeset
   113
        excludeTestMaxRange("SharedMiscCodeSize");
33222
e0a340f4ab6e 8078556: Runtime: implement ranges (optionally constraints) for those flags that have them missing.
gziemski
parents: 33144
diff changeset
   114
e0a340f4ab6e 8078556: Runtime: implement ranges (optionally constraints) for those flags that have them missing.
gziemski
parents: 33144
diff changeset
   115
        /*
34178
e30e720da91b 8140327: segfault on solaris-amd64 with "-XX:CompilerThreadStackSize=1" option
zmajo
parents: 33230
diff changeset
   116
         * Remove the flag controlling the size of the stack because the
e30e720da91b 8140327: segfault on solaris-amd64 with "-XX:CompilerThreadStackSize=1" option
zmajo
parents: 33230
diff changeset
   117
         * flag has direct influence on the physical memory usage of
e30e720da91b 8140327: segfault on solaris-amd64 with "-XX:CompilerThreadStackSize=1" option
zmajo
parents: 33230
diff changeset
   118
         * the VM.
e30e720da91b 8140327: segfault on solaris-amd64 with "-XX:CompilerThreadStackSize=1" option
zmajo
parents: 33230
diff changeset
   119
         */
e30e720da91b 8140327: segfault on solaris-amd64 with "-XX:CompilerThreadStackSize=1" option
zmajo
parents: 33230
diff changeset
   120
        allOptionsAsMap.remove("CompilerThreadStackSize");
e30e720da91b 8140327: segfault on solaris-amd64 with "-XX:CompilerThreadStackSize=1" option
zmajo
parents: 33230
diff changeset
   121
e30e720da91b 8140327: segfault on solaris-amd64 with "-XX:CompilerThreadStackSize=1" option
zmajo
parents: 33230
diff changeset
   122
        /*
33222
e0a340f4ab6e 8078556: Runtime: implement ranges (optionally constraints) for those flags that have them missing.
gziemski
parents: 33144
diff changeset
   123
         * Exclude MallocMaxTestWords as it is expected to exit VM at small values (>=0)
e0a340f4ab6e 8078556: Runtime: implement ranges (optionally constraints) for those flags that have them missing.
gziemski
parents: 33144
diff changeset
   124
         */
34275
9b1771bfd6cf 8143038: [TESTBUG] TestOptionsWithRanges: allow excluding only a subset of tested values specified for a flag
ddmitriev
parents: 34242
diff changeset
   125
        excludeTestMinRange("MallocMaxTestWords");
33222
e0a340f4ab6e 8078556: Runtime: implement ranges (optionally constraints) for those flags that have them missing.
gziemski
parents: 33144
diff changeset
   126
e0a340f4ab6e 8078556: Runtime: implement ranges (optionally constraints) for those flags that have them missing.
gziemski
parents: 33144
diff changeset
   127
        /*
33144
c56850e328fc 8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents: 31372
diff changeset
   128
         * Exclude below options as their maximum value would consume too much memory
c56850e328fc 8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents: 31372
diff changeset
   129
         * and would affect other tests that run in parallel.
c56850e328fc 8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents: 31372
diff changeset
   130
         */
34661
9a1d11d88ea0 8142341: GC: current flags need ranges to be implemented
sangheki
parents: 34317
diff changeset
   131
        excludeTestMaxRange("ConcGCThreads");
34275
9b1771bfd6cf 8143038: [TESTBUG] TestOptionsWithRanges: allow excluding only a subset of tested values specified for a flag
ddmitriev
parents: 34242
diff changeset
   132
        excludeTestMaxRange("G1ConcRefinementThreads");
9b1771bfd6cf 8143038: [TESTBUG] TestOptionsWithRanges: allow excluding only a subset of tested values specified for a flag
ddmitriev
parents: 34242
diff changeset
   133
        excludeTestMaxRange("G1RSetRegionEntries");
9b1771bfd6cf 8143038: [TESTBUG] TestOptionsWithRanges: allow excluding only a subset of tested values specified for a flag
ddmitriev
parents: 34242
diff changeset
   134
        excludeTestMaxRange("G1RSetSparseRegionEntries");
9b1771bfd6cf 8143038: [TESTBUG] TestOptionsWithRanges: allow excluding only a subset of tested values specified for a flag
ddmitriev
parents: 34242
diff changeset
   135
        excludeTestMaxRange("G1UpdateBufferSize");
9b1771bfd6cf 8143038: [TESTBUG] TestOptionsWithRanges: allow excluding only a subset of tested values specified for a flag
ddmitriev
parents: 34242
diff changeset
   136
        excludeTestMaxRange("InitialBootClassLoaderMetaspaceSize");
34661
9a1d11d88ea0 8142341: GC: current flags need ranges to be implemented
sangheki
parents: 34317
diff changeset
   137
        excludeTestMaxRange("InitialHeapSize");
9a1d11d88ea0 8142341: GC: current flags need ranges to be implemented
sangheki
parents: 34317
diff changeset
   138
        excludeTestMaxRange("MaxHeapSize");
9a1d11d88ea0 8142341: GC: current flags need ranges to be implemented
sangheki
parents: 34317
diff changeset
   139
        excludeTestMaxRange("MaxRAM");
9a1d11d88ea0 8142341: GC: current flags need ranges to be implemented
sangheki
parents: 34317
diff changeset
   140
        excludeTestMaxRange("NewSize");
9a1d11d88ea0 8142341: GC: current flags need ranges to be implemented
sangheki
parents: 34317
diff changeset
   141
        excludeTestMaxRange("OldSize");
9a1d11d88ea0 8142341: GC: current flags need ranges to be implemented
sangheki
parents: 34317
diff changeset
   142
        excludeTestMaxRange("ParallelGCThreads");
9a1d11d88ea0 8142341: GC: current flags need ranges to be implemented
sangheki
parents: 34317
diff changeset
   143
9a1d11d88ea0 8142341: GC: current flags need ranges to be implemented
sangheki
parents: 34317
diff changeset
   144
        excludeTestMaxRange("VMThreadStackSize");
33144
c56850e328fc 8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents: 31372
diff changeset
   145
33198
dlong
parents: 33144 33163
diff changeset
   146
        /*
33163
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 31372
diff changeset
   147
         * Remove parameters controlling the code cache. As these
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 31372
diff changeset
   148
         * parameters have implications on the physical memory
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 31372
diff changeset
   149
         * reserved by the VM, setting them to large values may hang
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 31372
diff changeset
   150
         * the system and/or may cause concurrently executed tests to
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 31372
diff changeset
   151
         * fail. These parameters are rigorously checked when the code
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 31372
diff changeset
   152
         * cache is initialized (see
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 31372
diff changeset
   153
         * hotspot/src/shared/vm/code/codeCache.cpp), therefore
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 31372
diff changeset
   154
         * omitting testing for them does not pose a problem.
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 31372
diff changeset
   155
         */
34275
9b1771bfd6cf 8143038: [TESTBUG] TestOptionsWithRanges: allow excluding only a subset of tested values specified for a flag
ddmitriev
parents: 34242
diff changeset
   156
        excludeTestMaxRange("InitialCodeCacheSize");
9b1771bfd6cf 8143038: [TESTBUG] TestOptionsWithRanges: allow excluding only a subset of tested values specified for a flag
ddmitriev
parents: 34242
diff changeset
   157
        excludeTestMaxRange("CodeCacheMinimumUseSpace");
9b1771bfd6cf 8143038: [TESTBUG] TestOptionsWithRanges: allow excluding only a subset of tested values specified for a flag
ddmitriev
parents: 34242
diff changeset
   158
        excludeTestMaxRange("ReservedCodeCacheSize");
9b1771bfd6cf 8143038: [TESTBUG] TestOptionsWithRanges: allow excluding only a subset of tested values specified for a flag
ddmitriev
parents: 34242
diff changeset
   159
        excludeTestMaxRange("NonProfiledCodeHeapSize");
9b1771bfd6cf 8143038: [TESTBUG] TestOptionsWithRanges: allow excluding only a subset of tested values specified for a flag
ddmitriev
parents: 34242
diff changeset
   160
        excludeTestMaxRange("ProfiledCodeHeapSize");
9b1771bfd6cf 8143038: [TESTBUG] TestOptionsWithRanges: allow excluding only a subset of tested values specified for a flag
ddmitriev
parents: 34242
diff changeset
   161
        excludeTestMaxRange("NonNMethodCodeHeapSize");
9b1771bfd6cf 8143038: [TESTBUG] TestOptionsWithRanges: allow excluding only a subset of tested values specified for a flag
ddmitriev
parents: 34242
diff changeset
   162
        excludeTestMaxRange("CodeCacheExpansionSize");
33163
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 31372
diff changeset
   163
31372
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
   164
        allOptions = new ArrayList<>(allOptionsAsMap.values());
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
   165
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
   166
        Asserts.assertGT(allOptions.size(), 0, "Options with ranges not found!");
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
   167
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
   168
        System.out.println("Parsed " + allOptions.size() + " options with ranges. Start test!");
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
   169
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
   170
        failedTests = JVMOptionsUtils.runCommandLineTests(allOptions);
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
   171
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
   172
        Asserts.assertEQ(failedTests, 0,
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
   173
                String.format("%d tests failed! %s", failedTests, JVMOptionsUtils.getMessageWithFailures()));
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
   174
    }
9821df46cf47 8072931: JEP-JDK-8059557: Test task: test framework development
ddmitriev
parents:
diff changeset
   175
}