BUG : return code output display was wrong
This commit is contained in:
parent
da3b618def
commit
ee8fdcbc4a
1 changed files with 5 additions and 5 deletions
10
test.sh
10
test.sh
|
@ -62,15 +62,15 @@ while IFS='' read -r i || [[ -n "$line" ]]; do
|
||||||
args=$(echo $i | cut -d: -f1)
|
args=$(echo $i | cut -d: -f1)
|
||||||
e_code=$(echo $i | cut -d: -f2)
|
e_code=$(echo $i | cut -d: -f2)
|
||||||
msg "\nScript *${COMMAND}*, paramètres **${args}**\n"
|
msg "\nScript *${COMMAND}*, paramètres **${args}**\n"
|
||||||
ret=$(./$COMMAND $args 2>&1)
|
ret_o=$(./$COMMAND $args 2>&1)
|
||||||
|
ret_c=$?
|
||||||
if [[ $? == $e_code ]]
|
if [[ $ret_c == $e_code ]]
|
||||||
then
|
then
|
||||||
msg "green" "\tLe code de retour est celui attendu (${e_code})\n"
|
msg "green" "\tLe code de retour est celui attendu (${e_code})\n"
|
||||||
else
|
else
|
||||||
msg "yellow" "\tLe code de retour n'est pas correct script : ${#} attendu : ${e_code}\n"
|
msg "yellow" "\tLe code de retour n'est pas correct script : ${ret_c} attendu : ${e_code}\n"
|
||||||
fi
|
fi
|
||||||
msg "blue" "\tRetour : ${ret}\n"
|
msg "blue" "\tRetour : ${ret_o}\n"
|
||||||
done < "$TEST_FILE"
|
done < "$TEST_FILE"
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue