diff --git a/run_test.py b/run_test.py
new file mode 100644
index 0000000000000000000000000000000000000000..b71aab002d9d669657b3f979bcce41f5b405c225
--- /dev/null
+++ b/run_test.py
@@ -0,0 +1,88 @@
+import os
+import shutil
+import subprocess as sp
+libs_dir_list = [
+ '../../out/hispark_taurus/clang_x64/ark/ark',
+ '../../out/hispark_taurus/clang_x64/ark/ark_js_runtime',
+ '../../out/hispark_taurus/clang_x64/thirdparty/icu',
+ '../../prebuilts/clang/ohos/linux-x86_64/llvm/lib'
+]
+
+ark_tool_list = [
+ '--ark-tool',
+ '../../out/hispark_taurus/clang_x64/ark/ark_js_runtime/ark_js_vm'
+]
+
+ark_frontend_tool_list = [
+ '--ark-frontend-tool',
+ '../../out/hispark_taurus/clang_x64/ark/ark/build/src/index.js'
+]
+
+build_target_list = [
+ 'ark_js_host_linux_tools_packages',
+ 'ark_ts2abc_build',
+ 'ts2abc_type_adapter_unit_tests'
+]
+
+libs_dir_str = ':'.join(libs_dir_list)
+ark_tool_str = '='.join(ark_tool_list)
+ark_frontend_tool_str = '='.join(ark_frontend_tool_list)
+ld_library_path_str = ':'.join([i.replace('../../', '') for i in libs_dir_list])
+build_target_str = ''
+for build_target in build_target_list:
+ build_target_str += ' --build-target' + ' ' + build_target
+
+
+build_cmd = [
+ './build.sh',
+ '--product-name',
+ 'hispark_taurus_standard',
+ build_target_str
+]
+
+test262_cmd = [
+ 'python3',
+ 'test262/run_test262.py',
+ '--es2021',
+ 'all',
+ '--libs-dir',
+ libs_dir_str,
+ ark_tool_str,
+ ark_frontend_tool_str
+]
+
+ut_cmd = [
+ 'python3',
+ 'ts2panda/scripts/run_tests.py'
+]
+
+testJs_cmd = [
+ 'python3',
+ 'testJs/run_testJs.py'
+]
+
+testTs_cmd = [
+ 'python3',
+ 'testTs/run_testTs.py'
+]
+
+ts_instruction_typemap_test_cmd = [
+ '../../out/hispark_taurus/clang_x64/ark/ark/ts2abc_type_adapter_unit_tests'
+]
+
+tests_list = [
+ test262_cmd,
+ ut_cmd,
+ testTs_cmd,
+ testJs_cmd,
+ ts_instruction_typemap_test_cmd
+]
+
+os.chdir('../../')
+if os.path.exists('./out'):
+ shutil.rmtree('./out')
+sp.run(build_cmd)
+os.environ['LD_LIBRARY_PATH'] = ld_library_path_str
+os.chdir('arkcompiler/ets_frontend/')
+for test in tests_list:
+ sp.run(test)
diff --git a/testJs/README.md b/testJs/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..05f208d4d1f227bfd15ed4a0bff9cd12c2624a01
--- /dev/null
+++ b/testJs/README.md
@@ -0,0 +1,16 @@
+### File Introduction
+
+### Environment preparation
+1. Compile the ets_frontend warehouse in the root directory of the Hongmeng system code. First delete the out directory, and then execute the ./build.sh --product-name hispark_taurus_standard --build-target ark_js_host_linux_tools_packages --build-target ark_ts2abc_build command to compile.
+2. Enter the tool build directory in the out file cd out/hispark_taurus/clang_x64/ark/ark/build, and use the npm install command to build the environment
+3. After setting up the environment, go to the Hongmeng system arkcompiler/ets_frontend directory
+
+
+### Execute the test framework
+1. Execute Options
+1.1 Perform full testing
+python3 ./testJs/run_testJs.py
+1.2 Execute the directory test
+python3 ./testJs/run_testJs.py --dir file directory, eg (./testJs/test/moduletest)
+1.3 Execute a single file test
+python3 ./testJs/run_testJs.py --file file path, eg (./testJs/test/moduletest/arr/arr.js)
\ No newline at end of file
diff --git a/testJs/README_zh.md b/testJs/README_zh.md
new file mode 100644
index 0000000000000000000000000000000000000000..2e12c28e358fd8839ba4960c2146677dd0f750e7
--- /dev/null
+++ b/testJs/README_zh.md
@@ -0,0 +1,18 @@
+# testJs
+
+### 文件简介
+
+### 环境准备
+1.在鸿蒙系统代码根目录下编译ets_frontend仓。先删除out目录,然后执行./build.sh --product-name hispark_taurus_standard --build-target ark_js_host_linux_tools_packages --build-target ark_ts2abc_build命令进行编译。
+2.进入out文件中的工具build目录 cd out/hispark_taurus/clang_x64/ark/ark/build,使用npm install命令进行环境搭建
+3.搭建完环境,进入到鸿蒙系统arkcompiler/ets_frontend目录下
+
+
+### 执行测试框架
+1.执行选项
+1.1 执行全量测试
+python3 ./testJs/run_testJs.py
+1.2 执行目录测试
+python3 ./testJs/run_testJs.py --dir 文件目录,例如(./testJs/test/moduletest)
+1.3 执行单个文件测试
+python3 ./testJs/run_testJs.py --file 文件路径,例如(./testJs/test/moduletest/arr/arr.js)
diff --git a/testJs/config.py b/testJs/config.py
new file mode 100644
index 0000000000000000000000000000000000000000..9ddc593f1206241edd2b298830a8ebfb09f5b9c2
--- /dev/null
+++ b/testJs/config.py
@@ -0,0 +1,49 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+"""
+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.
+
+Description: Use ark to execute test 262 test suite
+"""
+
+import os
+import json
+
+LD_LIBRARY_PATH_LIST = [
+ 'out/hispark_taurus/clang_x64/ark/ark',
+ 'out/hispark_taurus/clang_x64/ark/ark_js_runtime',
+ 'out/hispark_taurus/clang_x64/thirdparty/icu',
+ 'prebuilts/clang/ohos/linux-x86_64/llvm/lib'
+]
+
+OUT_DIR = os.path.join("out")
+OUT_TEST_DIR = os.path.join("out", "testJs")
+OUT_RESULT_FILE = os.path.join("out", "testJs", "result.txt")
+TEST_DIR = os.path.join("testJs")
+TS_CASES_DIR = os.path.join(".", "testJs", "test")
+CUR_FILE_DIR = os.path.dirname(__file__)
+CODE_ROOT = os.path.abspath(os.path.join(CUR_FILE_DIR, "../../.."))
+ARK_TS2ABC_PATH = 'arkcompiler/ets_frontend/'
+ARK_JS_VM = './out/hispark_taurus/clang_x64/ark/ark_js_runtime/ark_js_vm'
+ARK_DIR = f"{CODE_ROOT}/out/hispark_taurus/clang_x64/ark/ark"
+WORK_PATH = f'{CODE_ROOT}/{ARK_TS2ABC_PATH}'
+EXPECT_PATH = 'expect_output.txt'
+DEFAULT_ARK_FRONTEND_TOOL = os.path.join(ARK_DIR, "build", "src", "index.js")
+
+TEST_PATH = os.sep.join([".", "testJs", "test"])
+OUT_PATH = os.sep.join([".", "out", "testJs"])
+JS_EXT = ".js"
+TXT_EXT = ".txt"
+ABC_EXT = ".abc"
diff --git a/testJs/run_testJs.py b/testJs/run_testJs.py
new file mode 100644
index 0000000000000000000000000000000000000000..d769480cac7a393dc6406a1b77ce946594a93510
--- /dev/null
+++ b/testJs/run_testJs.py
@@ -0,0 +1,120 @@
+import os
+import subprocess
+import argparse
+import sys
+from utils import *
+from config import *
+
+
+def parse_args():
+ parser = argparse.ArgumentParser()
+ parser.add_argument('--dir', metavar='DIR', help="Directory to test")
+ parser.add_argument('--file', metavar='FILE', help="File to test")
+ parser.add_argument(
+ '--ark_frontend_tool',
+ help="ark frontend conversion tool")
+ arguments = parser.parse_args()
+ return arguments
+
+
+def run_js_test(filepath):
+ output_path = filepath.replace(JS_EXT, TXT_EXT)
+ command_os(['node', '--expose-gc', DEFAULT_ARK_FRONTEND_TOOL, filepath])
+ abc_filepath = ARK_TS2ABC_PATH + filepath.replace(JS_EXT, ABC_EXT)
+ os.chdir('../../')
+ run_abc_cmd = [ARK_JS_VM, abc_filepath]
+ run_abc_result = subprocess.Popen(run_abc_cmd, stdout=subprocess.PIPE)
+ js_result_list = []
+ for line in run_abc_result.stdout.readlines():
+ js_result = str(line).lstrip("b'").rstrip("\\n'")+'\n'
+ js_result_list.append(js_result)
+ remove_file(abc_filepath)
+ os.chdir(ARK_TS2ABC_PATH)
+ with open(output_path,'w') as output:
+ output.writelines(js_result_list)
+
+
+
+def compare(filepath):
+ outputfilepath = filepath.replace(JS_EXT, TXT_EXT)
+ outcont = read_file(outputfilepath)
+ ll = filepath.split(os.sep)
+ del ll[-1]
+ ll.append(EXPECT_PATH)
+ expectfilepath = (os.sep).join(ll)
+ expectcont = read_file(expectfilepath)
+ if outcont == expectcont:
+ result = f'PASS {filepath}\n'
+ else:
+ result = f'FAIL {filepath}\n'
+ remove_file(outputfilepath)
+ print(result)
+ return result
+
+
+def run_test_machine(args):
+ result_path = []
+ if args.file:
+ run_js_test(args.file)
+ result = compare(args.file)
+ result_path.append(result)
+ elif args.dir:
+ for root, dirs, files in os.walk(args.dir):
+ for file in files:
+ filepath = f'{root}/{file}'
+ if filepath.endswith(JS_EXT):
+ run_js_test(filepath)
+ result = compare(filepath)
+ result_path.append(result)
+ elif args.file is None and args.dir is None:
+ for root, dirs, files in os.walk(TS_CASES_DIR):
+ for file in files:
+ filepath = f'{root}/{file}'
+ if filepath.endswith(JS_EXT):
+ run_js_test(filepath)
+ result = compare(filepath)
+ result_path.append(result)
+ with open(OUT_RESULT_FILE, 'w') as read_out_result:
+ read_out_result.writelines(result_path)
+
+
+def init_path():
+ remove_dir(OUT_TEST_DIR)
+ mk_dir(OUT_TEST_DIR)
+
+
+def summary():
+ if not os.path.exists(OUT_RESULT_FILE):
+ return
+ count = -1
+ fail_count = 0
+ with open(OUT_RESULT_FILE, 'r') as read_outfile:
+ for count, line in enumerate(read_outfile):
+ if line.startswith("FAIL"):
+ fail_count += 1
+ pass
+ count += 1
+
+ print("\n Regression summary")
+ print("===============================")
+ print(" Total %5d " % (count))
+ print("-------------------------------")
+ print(" Passed tests: %5d " % (count - fail_count))
+ print(" Failed tests: %5d " % (fail_count))
+ print("===============================")
+
+
+def main(args):
+ try:
+ init_path()
+ excuting_npm_install(args)
+ export_path()
+ run_test_machine(args)
+ summary()
+ except BaseException:
+ print("Run Python Script Fail")
+
+
+if __name__ == "__main__":
+ sys.exit(main(parse_args()))
+
diff --git a/testJs/test/moduletest/allocatearraybuffer/allocatearraybuffer.js b/testJs/test/moduletest/allocatearraybuffer/allocatearraybuffer.js
new file mode 100644
index 0000000000000000000000000000000000000000..d16629afe8561d5ada7115947aeb7399665dc236
--- /dev/null
+++ b/testJs/test/moduletest/allocatearraybuffer/allocatearraybuffer.js
@@ -0,0 +1,18 @@
+/*
+ * 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.
+ */
+
+var newTarget = function() {}.bind(null);
+var arrayBuffer = Reflect.construct(ArrayBuffer, [16], newTarget);
+print(arrayBuffer.length);
\ No newline at end of file
diff --git a/testJs/test/moduletest/allocatearraybuffer/expect_output.txt b/testJs/test/moduletest/allocatearraybuffer/expect_output.txt
new file mode 100644
index 0000000000000000000000000000000000000000..417b7b5370df81a7316ee9f983437444afdae432
--- /dev/null
+++ b/testJs/test/moduletest/allocatearraybuffer/expect_output.txt
@@ -0,0 +1 @@
+undefined
diff --git a/testJs/utils.py b/testJs/utils.py
new file mode 100644
index 0000000000000000000000000000000000000000..20d30f02f682d314ffba53cbe47a8a1654d9b583
--- /dev/null
+++ b/testJs/utils.py
@@ -0,0 +1,82 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+"""
+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.
+
+Description: Use ark to execute test 262 test suite
+"""
+
+import os
+import shutil
+from config import *
+import subprocess
+
+
+def command_os(order):
+ subprocess.run(order)
+
+
+def mk_dir(path):
+ if not os.path.exists(path):
+ os.makedirs(path)
+
+
+def remove_dir(path):
+ if os.path.exists(path):
+ shutil.rmtree(path)
+
+
+def remove_file(path):
+ if os.path.exists(path):
+ os.remove(path)
+
+
+def read_file(path):
+ util_read_content = []
+ with open(path, "r") as utils_read:
+ util_read_content = utils_read.readlines()
+
+ return util_read_content
+
+
+def excuting_npm_install(args):
+ ark_frontend_tool = os.path.join(DEFAULT_ARK_FRONTEND_TOOL)
+ if args.ark_frontend_tool:
+ ark_frontend_tool = os.path.join(args.ark_frontend_tool)
+
+ ts2abc_build_dir = os.path.join(os.path.dirname(os.path.realpath(ark_frontend_tool)), "..")
+ if os.path.exists(os.path.join(ts2abc_build_dir, "package.json")):
+ npm_install(ts2abc_build_dir)
+ elif os.path.exists(os.path.join(ts2abc_build_dir, "..", "package.json")):
+ npm_install(os.path.join(ts2abc_build_dir, ".."))
+
+
+def npm_install(cwd):
+ try:
+ os.chdir(cwd)
+ command_os(["npm", "install"])
+ os.chdir(WORK_PATH)
+ except BaseException as e:
+ print(e)
+
+
+def export_path():
+ ld_library_path = ':'.join(LD_LIBRARY_PATH_LIST)
+ try:
+ os.chdir(CODE_ROOT)
+ os.environ['LD_LIBRARY_PATH'] = ld_library_path
+ os.chdir(WORK_PATH)
+ except BaseException as e:
+ print(e)