From 13a7f412f806fc40897bbb19f2b59fa9531cca8a Mon Sep 17 00:00:00 2001 From: Lluis Campos Date: Fri, 18 Nov 2022 16:15:58 +0100 Subject: [PATCH] test: Early abort when image conversion fails Signed-off-by: Lluis Campos --- scripts/test/test-utils.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/test/test-utils.sh b/scripts/test/test-utils.sh index 4bcd89c..1589108 100644 --- a/scripts/test/test-utils.sh +++ b/scripts/test/test-utils.sh @@ -91,10 +91,13 @@ convert_and_test() { done pytest_extra_args=$@ # Optional - run_convert ${artifact_name} ${image_file} ${extra_args} + local ret=0 + + run_convert ${artifact_name} ${image_file} ${extra_args} || ret=$? + + assert "${ret}" "0" "Failed to convert ${image_file}" local compression="${image_file##*.}" - local ret=0 image_name=$(image_name_after_conversion "${image_file}" "${compression}" "${device_type}") @@ -104,7 +107,7 @@ convert_and_test() { run_tests "${device_type}" "$(basename ${converted_image_uncompressed})" ${pytest_extra_args} || ret=$? - assert "${ret}" "0" "Failed to convert ${image_file}" + assert "${ret}" "0" "Tests failed for ${image_file}" }