test/hotspot/jtreg/compiler/aot/cli/AotLibraryNegativeBase.java
author rraghavan
Thu, 08 Aug 2019 14:13:16 +0530
changeset 57681 41f2f2829a09
parent 47216 71c04702a3d5
permissions -rw-r--r--
8227439: Turn off AOT by default Summary: Made UseAOT, AOTLibrary experimental and UseAOT false by default Reviewed-by: iignatyev, kvn
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
42650
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents:
diff changeset
     1
/*
57681
41f2f2829a09 8227439: Turn off AOT by default
rraghavan
parents: 47216
diff changeset
     2
 * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
42650
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents:
diff changeset
     4
 *
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents:
diff changeset
     7
 * published by the Free Software Foundation.
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents:
diff changeset
     8
 *
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents:
diff changeset
    13
 * accompanied this code).
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents:
diff changeset
    14
 *
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents:
diff changeset
    18
 *
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents:
diff changeset
    21
 * questions.
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents:
diff changeset
    22
 */
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents:
diff changeset
    23
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents:
diff changeset
    24
package compiler.aot.cli;
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents:
diff changeset
    25
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents:
diff changeset
    26
import compiler.aot.HelloWorldPrinter;
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents:
diff changeset
    27
import jdk.test.lib.process.ExitCode;
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents:
diff changeset
    28
import jdk.test.lib.cli.CommandLineOptionTest;
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents:
diff changeset
    29
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents:
diff changeset
    30
public class AotLibraryNegativeBase {
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents:
diff changeset
    31
    private static final String[] UNEXPECTED_MESSAGES = new String[] {
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents:
diff changeset
    32
        HelloWorldPrinter.MESSAGE
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents:
diff changeset
    33
    };
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents:
diff changeset
    34
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents:
diff changeset
    35
    public static void launchTest(String option, String expectedMessages[]) {
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents:
diff changeset
    36
        try {
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents:
diff changeset
    37
            boolean addTestVMOptions = true;
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents:
diff changeset
    38
            CommandLineOptionTest.verifyJVMStartup(expectedMessages,
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents:
diff changeset
    39
                    UNEXPECTED_MESSAGES,
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents:
diff changeset
    40
                    "Unexpected exit code using " + option,
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents:
diff changeset
    41
                    "Unexpected output using " + option, ExitCode.FAIL,
57681
41f2f2829a09 8227439: Turn off AOT by default
rraghavan
parents: 47216
diff changeset
    42
                    addTestVMOptions, "-XX:+UnlockExperimentalVMOptions", "-XX:+UseAOT",
41f2f2829a09 8227439: Turn off AOT by default
rraghavan
parents: 47216
diff changeset
    43
                    "-XX:+PrintAOT", option, HelloWorldPrinter.class.getName());
42650
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents:
diff changeset
    44
        } catch (Throwable t) {
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents:
diff changeset
    45
            throw new Error("Problems executing test using " + option
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents:
diff changeset
    46
                    + ": " + t, t);
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents:
diff changeset
    47
        }
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents:
diff changeset
    48
    }
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents:
diff changeset
    49
}