Skip to content

Commit 2aa6c40

Browse files
committed
Arm backend: Add test_arm_baremetal.sh checks
Test_arm_baremetal.sh didnt warn about missing setup_path.sh like other scripts. This patch makes it more like others. Change-Id: I124df660ce873d98fd067ce2441a396ac3c183fc
1 parent 8d8f677 commit 2aa6c40

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

backends/arm/test/test_arm_baremetal.sh

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,19 @@ script_dir=$(cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd)
1212
et_root_dir=$(cd ${script_dir}/../../.. && pwd)
1313
cd "${et_root_dir}"
1414
pwd
15+
setup_path_script=${et_root_dir}/examples/arm/ethos-u-scratch/setup_path.sh
16+
_setup_msg="please refer to ${et_root_dir}/examples/arm/setup.sh to properly install necessary tools."
1517

1618

1719
TEST_SUITE=$1
1820

21+
# Source the tools
22+
# This should be prepared by the setup.sh
23+
[[ -f ${setup_path_script} ]] \
24+
|| { echo "Missing ${setup_path_script}. ${_setup_msg}"; exit 1; }
25+
26+
source ${setup_path_script}
27+
1928
help() {
2029
echo "Usage:"
2130
echo " $0 <TESTNAME>"
@@ -66,7 +75,6 @@ test_pytest() { # Test ops and other things
6675
./examples/models/llama3_2_vision/install_requirements.sh
6776

6877
cd "${et_root_dir}"
69-
source examples/arm/ethos-u-scratch/setup_path.sh
7078
backends/arm/scripts/build_quantized_ops_aot_lib.sh
7179

7280
# Run arm baremetal pytest tests without FVP
@@ -78,7 +86,6 @@ test_pytest_ethosu_fvp() { # Same as test_pytest but also sometime verify using
7886
echo "${TEST_SUITE_NAME}: Run pytest with fvp"
7987

8088
./examples/models/llama3_2_vision/install_requirements.sh
81-
source examples/arm/ethos-u-scratch/setup_path.sh
8289

8390
# Prepare Corstone-3x0 FVP for pytest
8491
examples/arm/run.sh --model_name=add --build_only
@@ -92,8 +99,6 @@ test_pytest_ethosu_fvp() { # Same as test_pytest but also sometime verify using
9299
test_run_ethosu_fvp() { # End to End model tests using run.sh
93100
echo "${TEST_SUITE_NAME}: Test ethos-u delegate examples with run.sh"
94101

95-
source examples/arm/ethos-u-scratch/setup_path.sh
96-
97102
# TOSA quantized
98103
echo "${TEST_SUITE_NAME}: Test ethos-u target TOSA"
99104
examples/arm/run.sh --et_build_root=arm_test/test_run --target=TOSA --model_name=add
@@ -114,8 +119,6 @@ test_run_ethosu_fvp() { # End to End model tests using run.sh
114119
test_models_ethosu_fvp() { # End to End model tests using model_test.py
115120
echo "${TEST_SUITE_NAME}: Test ethos-u delegate models with test_model.py"
116121

117-
source examples/arm/ethos-u-scratch/setup_path.sh
118-
119122
# Build common libs once
120123
python3 backends/arm/test/test_model.py --test_output=arm_test/test_model --build_libs
121124

0 commit comments

Comments
 (0)