test/script/basic/JDK-8008448.js

Tue, 15 Jan 2019 10:36:25 +0000

author
aefimov
date
Tue, 15 Jan 2019 10:36:25 +0000
changeset 2462
e9169a96a3d1
parent 844
8f06a63adf4e
child 952
6d5471a497fb
permissions
-rw-r--r--

Added tag jdk8u202-ga for changeset 7aeae6eb6236

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

mercurial