Skip to content

Commit 3fedcbf

Browse files
authored
Don't allow silent failures for Xtensa binaries (#3156)
@tensorflow/micro Do not allow programs, which are not unit tests, to silently fail when run using the Xtensa simulator. The generic benchmark application is one such program for which failures were not being reported. Check the exit status of the simulator when running programs that are not unit tests. bug=fixes #3155
1 parent 120a73e commit 3fedcbf

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tensorflow/lite/micro/testing/test_xtensa_binary.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash -e
2-
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
2+
# Copyright 2025 The TensorFlow Authors. All Rights Reserved.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -26,7 +26,8 @@ declare -r MICRO_LOG_PATH=${TEST_TMPDIR}/$1
2626
declare -r MICRO_LOG_FILENAME=${MICRO_LOG_PATH}/logs.txt
2727
mkdir -p ${MICRO_LOG_PATH}
2828

29-
xt-run $1 2>&1 | tee ${MICRO_LOG_FILENAME}
29+
xt-run --exit_with_target_code $1 2>&1 | tee ${MICRO_LOG_FILENAME}
30+
STATUS=${PIPESTATUS[0]}
3031

3132
if [[ ${2} != "non_test_binary" ]]
3233
then
@@ -36,5 +37,6 @@ then
3637
else
3738
exit 1
3839
fi
40+
else
41+
exit ${STATUS}
3942
fi
40-

0 commit comments

Comments
 (0)