Skip to content

Commit da5176a

Browse files
jaenrig-ifxactions-user
authored andcommitted
tests/ports/psoc6/run_psoc6_tests: Added fail fast by default.
Signed-off-by: jaenrig-ifx <enriquezgarcia.external@infineon.com>
1 parent 6ce79d3 commit da5176a

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

tests/ports/psoc6/run_psoc6_tests.sh

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ usage() {
6565
echo " --board, b board name"
6666
echo " --hil, h hardware-in-the-loop server name"
6767
echo
68+
echo " --not-fail-fast continue running tests even if one of them fails"
6869
}
6970

7071
for arg in "$@"; do
@@ -75,6 +76,7 @@ for arg in "$@"; do
7576
'--dev-stub') set -- "$@" '-s' ;;
7677
'--board') set -- "$@" '-b' ;;
7778
'--hil') set -- "$@" '-h' ;;
79+
'--not-fail-fast') set -- "$@" '-x' ;;
7880
*) set -- "$@" "$arg" ;;
7981
esac
8082
done
@@ -99,6 +101,9 @@ while getopts "b:d:h:s:t:x" o; do
99101
h)
100102
hil=${OPTARG}
101103
;;
104+
x)
105+
fail_fast=0
106+
;;
102107
*)
103108
usage
104109
exit 1
@@ -110,6 +115,10 @@ if [ -z "${afs}" ]; then
110115
afs=0
111116
fi
112117

118+
if [ -z "${fail_fast}" ]; then
119+
fail_fast=1
120+
fi
121+
113122
if [ -n "${board}" ] && [ -n "${hil}" ]; then
114123
# If the hil and board are provided, the script will use the get-devs.py discover automatically the
115124
# available devices.
@@ -152,6 +161,13 @@ exit_result=0
152161
update_test_result() {
153162
last_test_result=$1
154163
exit_result=$((${exit_result} | ${last_test_result}))
164+
165+
if [ ${exit_result} -ne 0 ]; then
166+
if [ ${fail_fast} -eq 1 ]; then
167+
echo "Test failed, exiting..."
168+
exit ${last_test_result}
169+
fi
170+
fi
155171
}
156172

157173
start_test_info() {
@@ -449,7 +465,6 @@ run_ci_tests() {
449465
spi_tests
450466
i2s_tests
451467
pdm_pcm_tests
452-
time_pulse_tests
453468
bitstream_tests
454469
wdt_tests
455470
time_pulse_tests

0 commit comments

Comments
 (0)