tests/utils/utils.sh: bt_diff_cli(): return directly, don't use `ret`
[babeltrace.git] / tests / utils / utils.sh
index 28361a639a1c23fe52c6bc9915316e0cf2eb67da..af500b9635751026f3c05e8a372cba2350557015 100644 (file)
@@ -249,11 +249,8 @@ bt_cli() {
 bt_diff() {
        local -r expected_file="$1"
        local -r actual_file="$2"
-       local ret=0
 
        diff -u <(bt_remove_cr_inline "$expected_file") <(bt_remove_cr_inline "$actual_file") 1>&2
-
-       return $?
 }
 
 # Checks the difference between:
@@ -280,7 +277,6 @@ bt_diff_cli() {
 
        local -r temp_stdout_output_file="$(mktemp -t actual-stdout.XXXXXX)"
        local -r temp_stderr_output_file="$(mktemp -t actual-stderr.XXXXXX)"
-       local ret=0
 
        bt_cli "$temp_stdout_output_file" "$temp_stderr_output_file" "${args[@]}"
 
@@ -289,13 +285,9 @@ bt_diff_cli() {
        bt_diff "$expected_stderr_file" "$temp_stderr_output_file" "${args[@]}"
        local -r ret_stderr=$?
 
-       if ((ret_stdout != 0 || ret_stderr != 0)); then
-               ret=1
-       fi
-
        rm -f "$temp_stdout_output_file" "$temp_stderr_output_file"
 
-       return $ret
+       return $((ret_stdout || ret_stderr))
 }
 
 # Checks the difference between:
This page took 0.02487 seconds and 4 git commands to generate.