From 1c30ff8f922dca9b8b31c3d84f534ef76985db9c Mon Sep 17 00:00:00 2001 From: xucheng46 Date: Mon, 15 Aug 2022 11:11:27 +0800 Subject: [PATCH] Add es2abc parser tests in gn action and enable it in CI Issue: https://gitee.com/openharmony/arkcompiler_ets_frontend/issues/I5NMXF Test: build, parser test Signed-off-by: xucheng46 Change-Id: I30a9554f6c70a4aa198ddb2779542f019b4a3331 --- es2panda/BUILD.gn | 4 ++++ es2panda/test/.gitignore | 1 + es2panda/test/BUILD.gn | 28 ++++++++++++++++++++++++++++ es2panda/test/runner.py | 1 - 4 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 es2panda/test/.gitignore create mode 100644 es2panda/test/BUILD.gn mode change 100644 => 100755 es2panda/test/runner.py diff --git a/es2panda/BUILD.gn b/es2panda/BUILD.gn index 6bd30c9e88..047ccf5886 100644 --- a/es2panda/BUILD.gn +++ b/es2panda/BUILD.gn @@ -518,3 +518,7 @@ group("es2panda_build") { group("es2panda_build_win") { deps = [ ":es2panda(${toolchain_win})" ] } + +group("es2abc_tests") { + deps = [ "./test:es2abc_parser_tests" ] +} diff --git a/es2panda/test/.gitignore b/es2panda/test/.gitignore new file mode 100644 index 0000000000..0d20b6487c --- /dev/null +++ b/es2panda/test/.gitignore @@ -0,0 +1 @@ +*.pyc diff --git a/es2panda/test/BUILD.gn b/es2panda/test/BUILD.gn new file mode 100644 index 0000000000..1ce46568c7 --- /dev/null +++ b/es2panda/test/BUILD.gn @@ -0,0 +1,28 @@ +# Copyright (c) 2022 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//arkcompiler/ets_frontend/es2panda/es2abc_config.gni") + +action("es2abc_parser_tests") { + script = "${es2abc_root}/test/runner.py" + + deps = es2abc_build_deps + + args = [ + "--no-progress", + "--regression", + rebase_path("${es2abc_build_path}"), + ] + + outputs = [ "${es2abc_build_path}/keep_es2abc_parser_tests_run" ] +} diff --git a/es2panda/test/runner.py b/es2panda/test/runner.py old mode 100644 new mode 100755 index 00a84d294f..b4793f8485 --- a/es2panda/test/runner.py +++ b/es2panda/test/runner.py @@ -26,7 +26,6 @@ import subprocess import sys import test262util - def is_directory(parser, arg): if not path.isdir(arg): parser.error("The directory '%s' does not exist" % arg) -- Gitee