1#!/usr/bin/env python3 2# -*- coding: utf-8 -*- 3 4""" 5Copyright (c) 2021-2022 Huawei Device Co., Ltd. 6Licensed under the Apache License, Version 2.0 (the "License"); 7you may not use this file except in compliance with the License. 8You may obtain a copy of the License at 9 10 http://www.apache.org/licenses/LICENSE-2.0 11 12Unless required by applicable law or agreed to in writing, software 13distributed under the License is distributed on an "AS IS" BASIS, 14WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15See the License for the specific language governing permissions and 16limitations under the License. 17 18Description: Execute 262 test suite configuration file 19""" 20 21 22import os 23 24DATA_DIR = os.path.join("test262", "data") 25ESHOST_DIR = os.path.join("test262", "eshost") 26HARNESS_DIR = os.path.join("test262", "harness") 27 28BASE_OUT_DIR = os.path.join("out", "test262") 29 30CUR_FILE_DIR = os.path.dirname(__file__) 31CODE_ROOT = os.path.abspath(os.path.join(CUR_FILE_DIR, "../../..")) 32ARK_DIR = f"{CODE_ROOT}/out/hi3516dv300/clang_x64/ark/ark" 33ICUI_DIR = f"{CODE_ROOT}/out/hi3516dv300/clang_x64/global/i18n_standard" 34LLVM_DIR = f"{CODE_ROOT}/prebuilts/clang/ohos/linux-x86_64/llvm/lib/" 35ARK_JS_RUNTIME_DIR = f"{CODE_ROOT}/out/hi3516dv300/clang_x64/ark/ark_js_runtime" 36 37DEFAULT_MODE = 2 38 39TEST_ES5_DIR = os.path.join(DATA_DIR, "test_es51") 40TEST_ES2015_DIR = os.path.join(DATA_DIR, "test_es2015") 41TEST_CI_DIR = os.path.join(DATA_DIR, "test_CI") 42 43DEFAULT_ARK_FRONTEND_TOOL = os.path.join(ARK_DIR, "build", "src", "index.js") 44DEFAULT_ARK_TOOL = os.path.join(ARK_JS_RUNTIME_DIR, "ark_js_vm") 45DEFAULT_LIBS_DIR = f"{ARK_DIR}:{ICUI_DIR}:{LLVM_DIR}:{ARK_JS_RUNTIME_DIR}" 46 47DEFAULT_HOST_TYPE = "panda" 48DEFAULT_HOST_PATH = "python3" 49DEFAULT_THREADS = 8 50DEFAULT_OTHER_ARGS = "--saveCompiledTests" 51TEST262_RUNNER_SCRIPT = os.path.join(HARNESS_DIR, "bin", "run.js") 52DEFAULT_TIMEOUT = 60000 53 54 55ES5_LIST_FILE = os.path.join("test262", "es5_tests.txt") 56ES2015_LIST_FILE = os.path.join("test262", "es2015_tests.txt") 57CI_LIST_FILE = os.path.join("test262", "CI_tests.txt") 58 59TEST262_GIT_HASH = "9ca13b12728b7e0089c7eb03fa2bd17f8abe297f" 60HARNESS_GIT_HASH = "9c499f028eb24e67781435c0bb442e00343eb39d" 61ESHOST_GIT_HASH = "fa2d4d27d9d6152002bdef36ee2d17e98b886268" 62ESNEXT_GIT_HASH = "281eb10b2844929a7c0ac04527f5b42ce56509fd" 63 64TEST262_GIT_URL = "https://gitee.com/Han00000000/test262.git" 65ESHOST_GIT_URL = "https://gitee.com/Han00000000/eshost.git" 66HARNESS_GIT_URL = "https://gitee.com/Han00000000/test262-harness.git" 67 68SKIP_LIST_FILE = os.path.join("test262", "skip_tests.json") 69ALL_SKIP_TESTS = [] 70 71ARK_FRONTEND_LIST = [ 72 "ts2panda", 73 "es2panda" 74] 75DEFAULT_ARK_FRONTEND = ARK_FRONTEND_LIST[0] 76 77ARK_ARCH_LIST = [ 78 "x64", 79 "aarch64", 80 "arm" 81] 82 83DEFAULT_ARK_ARCH = ARK_ARCH_LIST[0] 84 85MODULE_FILES_LIST = [ 86 "early-dup-export-decl.js", 87 "early-dup-export-dflt-id.js", 88 "early-dup-export-dflt.js", 89 "early-dup-export-id-as.js", 90 "early-dup-export-id.js", 91 "early-dup-lables.js", 92 "early-dup-lex.js", 93 "early-export-global.js", 94 "early-lex-and-var.js", 95 "early-new-target.js", 96 "early-strict-mode.js", 97 "early-super.js", 98 "early-undef-break.js", 99 "early-undef-continue.js", 100 "parse-err-export-dflt-const.js", 101 "parse-err-export-dflt-let.js", 102 "parse-err-export-dflt-var.js", 103 "parse-err-return.js", 104 "parse-err-yield.js", 105 "dup-bound-names.js", 106 "await-module.js" 107] 108