TestWarnErrorCount.java revision 897
897N/A * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. 897N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 897N/A * This code is free software; you can redistribute it and/or modify it 897N/A * under the terms of the GNU General Public License version 2 only, as 897N/A * published by the Free Software Foundation. 897N/A * This code is distributed in the hope that it will be useful, but WITHOUT 897N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 897N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 897N/A * version 2 for more details (a copy is included in the LICENSE file that 897N/A * accompanied this code). 897N/A * You should have received a copy of the GNU General Public License version 897N/A * 2 along with this work; if not, write to the Free Software Foundation, 897N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 897N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 897N/A * or visit www.oracle.com if you need additional information or have any 897N/A * @summary repeated warnings about bootclasspath not set 897N/A * @build JavacTestingAbstractProcessor TestWarnErrorCount 897N/A * @run main TestWarnErrorCount 897N/A * Type of errors to generate in test case. 897N/A /** Source code errors. */ 897N/A /** Errors reported to Messager. */ 897N/A /** Error as a result of using -Werror. */ 897N/A * Frequency of warnings in test case. 897N/A /** Generate a warning if round count is a multiple of 2. */ 897N/A /** Generate a warning if round count is a multiple of 3. */ 897N/A /** Generate a warning every round. */ 897N/A /** whether to generate a warning in round 'round'. */ 897N/A /** number of warnings generated in a range of rounds, inclusive. */ 897N/A * @param args provide ability to specify particular test cases for debugging. 897N/A * @param ek The type of errors to generate 897N/A * @param mwk The frequency of Messager warnings to generate 897N/A * @param jwk The frequency of Java warnings to generate 897N/A // Scan the output looking for messages of interest. 897N/A // Compute the expected number of errors and warnings, based on 897N/A // the test case parameters. 897N/A // This is highly specific to the annotation processor below, and to 897N/A // the files it generates. 897N/A // Generally, the rules are: 897N/A // -- errors stop annotation processing, allowing for one extra "last round" 897N/A // -- messager warnings are immediate 897N/A // -- javac warnings are not shown before the final compilation 897N/A // (FIXME? -Werror does not stop processing for java warnings) 897N/A :
1;
// this is surprising: javac only reports warning in first file 897N/A error(
"number of " +
l1 +
" found, " +
i1 +
", does not match number " +
l2 +
", " +
i2);
897N/A // ----- Annotation processor -----