1#!/bin/bash 2# Copyright (c) 2021-2022 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 15# Huawei Technologies Co.,Ltd. 16set -e 17 18for ARGUMENT in "$@" 19do 20case "$ARGUMENT" in 21 --binary-dir=*) 22 PANDA_BINARY_ROOT="${ARGUMENT#*=}" 23 ;; 24 --root-dir=*) 25 PANDA_ROOT="${ARGUMENT#*=}" 26 ;; 27esac 28done 29 30exec 2>/dev/null 31 32$PANDA_BINARY_ROOT/bin-gtests/bytecodeopt_unit_tests 33if test -f "$PANDA_BINARY_ROOT/bin-gtests/bytecodeopt_unit_tests_java"; then 34 $PANDA_BINARY_ROOT/bin-gtests/bytecodeopt_unit_tests_java 35fi 36if test -f "$PANDA_BINARY_ROOT/bin-gtests/bytecodeopt_unit_tests_ecma"; then 37 $PANDA_BINARY_ROOT/bin-gtests/bytecodeopt_unit_tests_ecma 38fi 39 40gcov $PANDA_BINARY_ROOT/bytecode_optimizer/CMakeFiles/arkbytecodeopt.dir 41if [ -x "$(command -v gcovr)" ]; then 42 echo "gcovr found" 43 gcovr --version 44 gcovr -v -r $PANDA_ROOT/bytecode_optimizer -e $PANDA_ROOT/bytecode_optimizer/tests --object-directory=$PANDA_BINARY_ROOT --html-details --html -o report.html 45else 46 echo "gcovr not found" 47 exit 1 48fi 49 50exit 0 51