Improve translation error checking
If translate_ciphers.py is used incorrectly in compat.sh, an error
check function - check_translation - is called to evaluate and inform
the user of the error that has occured.
Added an output that informs the users an error has taken place in
translate_ciphers.py incase the error response is an empty string.
Signed-off-by: Joe Subbiani <joe.subbiani@arm.com>
diff --git a/tests/compat.sh b/tests/compat.sh
index e532604..36018f2 100755
--- a/tests/compat.sh
+++ b/tests/compat.sh
@@ -238,8 +238,9 @@
check_translation()
{
- if [ $? -eq 1 ]; then
- echo $T
+ if [ $1 -ne 0 ]; then
+ echo "translate_ciphers.py failed with exit code $1" >&2
+ echo "$2" >&2
exit 1
fi
}
@@ -329,11 +330,11 @@
M_CIPHERS="$M_CIPHERS $CIPHERS"
T=`python3 scripts/translate_ciphers.py g "$CIPHERS"`
- check_translation $? $T
+ check_translation $? "$T"
G_CIPHERS="$G_CIPHERS $T"
T=`python3 scripts/translate_ciphers.py o "$CIPHERS"`
- check_translation $? $T
+ check_translation $? "$T"
O_CIPHERS="$O_CIPHERS $T"
}
@@ -417,7 +418,7 @@
M_CIPHERS="$M_CIPHERS $CIPHERS"
T=`python3 scripts/translate_ciphers.py o "$CIPHERS"`
- check_translation $? $T
+ check_translation $? "$T"
O_CIPHERS="$O_CIPHERS $T"
}
@@ -551,7 +552,7 @@
M_CIPHERS="$M_CIPHERS $CIPHERS"
T=`python3 scripts/translate_ciphers.py g "$CIPHERS"`
- check_translation $? $T
+ check_translation $? "$T"
G_CIPHERS="$G_CIPHERS $T"
}