< prev index next >

test/tools/javac/tree/TreePosTest.java

Print this page


   1 /*
   2  * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */


  91  * errors can be displayed in a gui viewer. For info on command line args,
  92  * run program with no args.
  93  *
  94  * <p>
  95  * jtreg: Note that by using the -r switch in the test description below, this test
  96  * will process all java files in the langtools/test directory, thus implicitly
  97  * covering any new language features that may be tested in this test suite.
  98  */
  99 
 100 /*
 101  * @test
 102  * @bug 6919889
 103  * @summary assorted position errors in compiler syntax trees
 104  * OLD: -q -r -ef ./tools/javac/typeAnnotations -ef ./tools/javap/typeAnnotations -et ANNOTATED_TYPE .
 105  * @modules java.desktop
 106  *          jdk.compiler/com.sun.tools.javac.api
 107  *          jdk.compiler/com.sun.tools.javac.code
 108  *          jdk.compiler/com.sun.tools.javac.file
 109  *          jdk.compiler/com.sun.tools.javac.tree
 110  *          jdk.compiler/com.sun.tools.javac.util
 111  * @run main/othervm TreePosTest -q -r .
 112  */
 113 public class TreePosTest {
 114     /**
 115      * Main entry point.
 116      * If test.src is set, program runs in jtreg mode, and will throw an Error
 117      * if any errors arise, otherwise System.exit will be used, unless the gui
 118      * viewer is being used. In jtreg mode, the default base directory for file
 119      * args is the value of ${test.src}. In jtreg mode, the -r option can be
 120      * given to change the default base directory to the root test directory.
 121      */
 122     public static void main(String... args) throws IOException {
 123         String testSrc = System.getProperty("test.src");
 124         File baseDir = (testSrc == null) ? null : new File(testSrc);
 125         boolean ok = new TreePosTest().run(baseDir, args);
 126         if (!ok) {
 127             if (testSrc != null)  // jtreg mode
 128                 throw new Error("failed");
 129             else
 130                 System.exit(1);
 131         }


   1 /*
   2  * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */


  91  * errors can be displayed in a gui viewer. For info on command line args,
  92  * run program with no args.
  93  *
  94  * <p>
  95  * jtreg: Note that by using the -r switch in the test description below, this test
  96  * will process all java files in the langtools/test directory, thus implicitly
  97  * covering any new language features that may be tested in this test suite.
  98  */
  99 
 100 /*
 101  * @test
 102  * @bug 6919889
 103  * @summary assorted position errors in compiler syntax trees
 104  * OLD: -q -r -ef ./tools/javac/typeAnnotations -ef ./tools/javap/typeAnnotations -et ANNOTATED_TYPE .
 105  * @modules java.desktop
 106  *          jdk.compiler/com.sun.tools.javac.api
 107  *          jdk.compiler/com.sun.tools.javac.code
 108  *          jdk.compiler/com.sun.tools.javac.file
 109  *          jdk.compiler/com.sun.tools.javac.tree
 110  *          jdk.compiler/com.sun.tools.javac.util
 111  * @run main TreePosTest -q -r .
 112  */
 113 public class TreePosTest {
 114     /**
 115      * Main entry point.
 116      * If test.src is set, program runs in jtreg mode, and will throw an Error
 117      * if any errors arise, otherwise System.exit will be used, unless the gui
 118      * viewer is being used. In jtreg mode, the default base directory for file
 119      * args is the value of ${test.src}. In jtreg mode, the -r option can be
 120      * given to change the default base directory to the root test directory.
 121      */
 122     public static void main(String... args) throws IOException {
 123         String testSrc = System.getProperty("test.src");
 124         File baseDir = (testSrc == null) ? null : new File(testSrc);
 125         boolean ok = new TreePosTest().run(baseDir, args);
 126         if (!ok) {
 127             if (testSrc != null)  // jtreg mode
 128                 throw new Error("failed");
 129             else
 130                 System.exit(1);
 131         }


< prev index next >