1#!/bin/bash 2# Copyright (c) 2021 Huawei Device Co., Ltd. 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14 15set -e 16 17pushd ark/ts2abc 18 time=$(date +'%Y%m%d%H%M%S') 19 if [ ! -d report ];then 20 mkdir report 21 fi 22 23 python3 test262/run_test262.py --ci-build --libs-dir ../../out/ohos-arm-release/clang_x64/ark/ark:../../out/ohos-arm-release/clang_x64/ark/ark_js_runtime:../../out/ohos-arm-release/clang_x64/global/i18n_standard:../../prebuilts/clang/ohos/linux-x86_64/llvm/lib --ark-tool=../../out/ohos-arm-release/clang_x64/ark/ark_js_runtime/ark_js_vm --ark-frontend-tool=../../out/ohos-arm-release/clang_x64/ark/ark/build/src/index.js 24 25 if [ $? -ne 0 ];then 26 echo 'execute run_test262.py failed!' 27 exit 1; 28 fi 29 30 if [ ! -f out/test262/result.txt ];then 31 echo 'The result.txt file of test262 is not produced!' 32 exit 1; 33 fi 34 35 cp out/test262/result.txt report/result_es2015_${time}.txt 36 37 pushd report 38 es2015_fail=$(grep FAIL result_es2015_${time}.txt | wc -l) 39 threshold=0 40 if [ ${es2015_fail} -gt ${threshold} ];then 41 echo 'test262 fail case over thresgold' 42 exit 1; 43 else 44 exit 0; 45 fi 46 popd 47popd 48