1#!/usr/bin/env python3 2# -*- coding: utf-8 -*- 3 4""" 5Copyright (c) 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: Use ark to execute test 262 test suite 19""" 20 21import os 22import sys 23import platform 24import json 25TS_GIT_PATH = 'https://gitee.com/zhangrengao1/TypeScript.git' 26TS_TAG = "v4.3.5" 27 28EXPECT_DIR = os.path.join("testTs", "expect") 29OUT_DIR = os.path.join("out") 30OUT_TEST_DIR = os.path.join("out", "testTs") 31OUT_RESULT_FILE = os.path.join("out", "testTs", "result.txt") 32TEST_DIR = os.path.join("testTs") 33TS_CASES_DIR = os.path.join(".", "testTs", "test") 34SKIP_FILE_PATH = os.path.join("testTs", "skip_tests.json") 35CUR_FILE_DIR = os.path.dirname(__file__) 36IMPORT_FILE_PATH = os.path.join(CUR_FILE_DIR, "import_tests.json") 37CODE_ROOT = os.path.abspath(os.path.join(CUR_FILE_DIR, "../../..")) 38 39IS_LINUX_ARM64 = (sys.platform == "linux" and platform.machine().lower() == "aarch64") 40CLANG_TOOLCHAIN = "clang_arm64" if IS_LINUX_ARM64 else "clang_x64" 41ARK_DIR = f"{CODE_ROOT}/out/hispark_taurus/{CLANG_TOOLCHAIN}/arkcompiler/ets_frontend" 42 43WORK_PATH = f'{CODE_ROOT}/arkcompiler/ets_frontend' 44 45DEFAULT_ARK_FRONTEND_TOOL = os.path.join(ARK_DIR, "build", "src", "index.js") 46 47TEST_PATH = os.sep.join([".", "testTs", "test"]) 48OUT_PATH = os.sep.join([".", "out", "testTs"]) 49EXPECT_PATH = os.sep.join([".", "testTs", "expect"]) 50TS_EXT = ".ts" 51TXT_EXT = ".txt" 52ABC_EXT = ".abc" 53IMPORT_TEST = "" 54with open(IMPORT_FILE_PATH, 'r') as f: 55 content = f.read() 56 IMPORT_TEST = json.loads(content) 57