sundar@105: /* sundar@105: * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. sundar@105: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. sundar@105: * sundar@105: * This code is free software; you can redistribute it and/or modify it sundar@105: * under the terms of the GNU General Public License version 2 only, as sundar@105: * published by the Free Software Foundation. sundar@105: * sundar@105: * This code is distributed in the hope that it will be useful, but WITHOUT sundar@105: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or sundar@105: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License sundar@105: * version 2 for more details (a copy is included in the LICENSE file that sundar@105: * accompanied this code). sundar@105: * sundar@105: * You should have received a copy of the GNU General Public License version sundar@105: * 2 along with this work; if not, write to the Free Software Foundation, sundar@105: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. sundar@105: * sundar@105: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA sundar@105: * or visit www.oracle.com if you need additional information or have any sundar@105: * questions. sundar@105: */ sundar@105: sundar@105: /** sundar@105: * JDK-8008448: Add coverage test for jdk.nashorn.internal.ir.debug.JSONWriter sundar@105: * Ensure that all parseable files can be parsed using parser API. sundar@105: * sundar@105: * @test sundar@844: * @option --const-as-var sundar@105: * @option -scripting sundar@105: * @run sundar@105: */ sundar@105: sundar@105: var File = Java.type("java.io.File"); sundar@105: var FilenameFilter = Java.type("java.io.FilenameFilter"); sundar@136: var SourceHelper = Java.type("jdk.nashorn.test.models.SourceHelper") sundar@105: sundar@105: // Filter out non .js files sundar@105: var files = new File(__DIR__).listFiles(new FilenameFilter() { sundar@105: accept: function(f, n) { return n.endsWith(".js") } sundar@105: }); sundar@105: sundar@105: // load parser API sundar@105: load("nashorn:parser.js"); sundar@105: sundar@105: // parse each file to make sure it does not result in exception sundar@105: for each (var f in files) { sundar@136: parse(SourceHelper.readFully(f)); sundar@105: }