Raef Coles | b3d343b | 2020-12-08 09:31:43 +0000 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Jianliang Shen | 5375ddb | 2022-08-28 23:32:47 +0800 | [diff] [blame] | 2 | # Copyright (c) 2021-2022, Arm Limited. All rights reserved. |
Raef Coles | b3d343b | 2020-12-08 09:31:43 +0000 | [diff] [blame] | 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | |
| 6 | usage() |
| 7 | { |
Jianliang Shen | 5375ddb | 2022-08-28 23:32:47 +0800 | [diff] [blame] | 8 | echo "$0 [-s source_dir] [-d build_dir] [-b <build_type>] [-c <compiler>] [-p <fih_profile>] [-l <tfm_level>] [-f <function>] [-r]" |
Raef Coles | b3d343b | 2020-12-08 09:31:43 +0000 | [diff] [blame] | 9 | } |
| 10 | |
| 11 | # Parse arguments |
| 12 | while test $# -gt 0; do |
| 13 | case $1 in |
| 14 | -s|--source_dir) |
| 15 | SOURCE_DIR="$2" |
| 16 | shift |
| 17 | shift |
| 18 | ;; |
| 19 | -d|--build_dir) |
| 20 | BUILD_DIR="$2" |
| 21 | shift |
| 22 | shift |
| 23 | ;; |
| 24 | -b|--build_type) |
| 25 | BUILD_TYPE="$2" |
| 26 | shift |
| 27 | shift |
| 28 | ;; |
| 29 | -c|--compiler) |
| 30 | COMPILER="$2" |
| 31 | shift |
| 32 | shift |
| 33 | ;; |
Jianliang Shen | 5375ddb | 2022-08-28 23:32:47 +0800 | [diff] [blame] | 34 | -p|--fih_profile) |
Raef Coles | b3d343b | 2020-12-08 09:31:43 +0000 | [diff] [blame] | 35 | FIH_PROFILE="$2" |
| 36 | shift |
| 37 | shift |
| 38 | ;; |
| 39 | -l|--tfm_level) |
| 40 | TFM_LEVEL="$2" |
| 41 | shift |
| 42 | shift |
| 43 | ;; |
Jianliang Shen | 5375ddb | 2022-08-28 23:32:47 +0800 | [diff] [blame] | 44 | -f|--function) |
| 45 | FUNCTION="$2" |
| 46 | shift |
| 47 | shift |
| 48 | ;; |
| 49 | -r|--re-build) |
| 50 | RE_BUILD=1 |
| 51 | shift |
| 52 | shift |
| 53 | ;; |
Raef Coles | b3d343b | 2020-12-08 09:31:43 +0000 | [diff] [blame] | 54 | -h|--help) |
| 55 | usage |
| 56 | exit 0 |
| 57 | ;; |
| 58 | *) |
| 59 | echo "Invalid argument" |
| 60 | usage |
| 61 | exit 1 |
| 62 | ;; |
| 63 | esac |
| 64 | done |
| 65 | |
| 66 | SCRIPT_DIR=$(dirname $(realpath "${BASH_SOURCE[0]}")) |
| 67 | source ${SCRIPT_DIR}/util.sh |
| 68 | |
| 69 | TEST_DIR=$(realpath $(pwd)) |
| 70 | set_default SOURCE_DIR $(realpath ${TEST_DIR}/..) |
| 71 | |
| 72 | source ${SCRIPT_DIR}/fih_test_build_tfm.sh |
| 73 | source ${SCRIPT_DIR}/fih_test_make_manifest.sh |
| 74 | source ${SCRIPT_DIR}/fih_test_run_gdb.sh |