hotspot/test/compiler/startup/StartupOutput.java
changeset 40646 c5dfe23b92b1
parent 40059 c2304140ed64
child 40652 9e6d111b4089
equal deleted inserted replaced
40642:7f337136f657 40646:c5dfe23b92b1
     1 /*
     1 /*
     2  * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    21  * questions.
    21  * questions.
    22  */
    22  */
    23 
    23 
    24 /*
    24 /*
    25  * @test
    25  * @test
    26  * @bug 8026949
    26  * @bug 8026949 8164091
    27  * @summary Test ensures correct VM output during startup
    27  * @summary Test ensures correct VM output during startup
    28  * @library /testlibrary
    28  * @library /testlibrary
    29  * @modules java.base/jdk.internal.misc
    29  * @modules java.base/jdk.internal.misc
    30  *          java.management
    30  *          java.management
    31  *
    31  *
    43         OutputAnalyzer out;
    43         OutputAnalyzer out;
    44 
    44 
    45         pb = ProcessTools.createJavaProcessBuilder("-Xint", "-XX:+DisplayVMOutputToStdout", "-version");
    45         pb = ProcessTools.createJavaProcessBuilder("-Xint", "-XX:+DisplayVMOutputToStdout", "-version");
    46         out = new OutputAnalyzer(pb.start());
    46         out = new OutputAnalyzer(pb.start());
    47         out.shouldNotContain("no space to run compilers");
    47         out.shouldNotContain("no space to run compilers");
       
    48         out.shouldHaveExitValue(0);
    48 
    49 
    49         out.shouldHaveExitValue(0);
    50         pb = ProcessTools.createJavaProcessBuilder("-Xint", "-XX:ReservedCodeCacheSize=1770K", "-XX:InitialCodeCacheSize=4K", "-version");
       
    51         out = new OutputAnalyzer(pb.start());
       
    52         // The VM should not crash but may return an error message because we don't have enough space for adapters
       
    53         int exitCode = out.getExitValue();
       
    54         if (exitCode != 1 && exitCode != 0) {
       
    55             throw new Exception("VM crashed with exit code " + exitCode);
       
    56         }
    50     }
    57     }
    51 }
    58 }