diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2020-12-24 23:54:36 +0100 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2021-01-05 23:27:26 +0100 |
commit | 69ce88bced3e0f5be536489770a3ea0c533fbfcd (patch) | |
tree | e6de9f5bf0f91e32dd3e23d549a98784308cafe6 /tests | |
parent | 71425f5eab177b941381619037e121c175cb23f1 (diff) |
tweak handover_tests.sh
We decided not to keep the handover_test script expected outputs
(osmo-bsc's logging output) in the source tree. Hence do not fail the
handover_tests when the output differs, just show a diff (if at all).
Change-Id: I3e9e123b41be71d1fcd9576b0bd38d2fd32353b4
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/handover/handover_tests.sh | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/tests/handover/handover_tests.sh b/tests/handover/handover_tests.sh index 68a8e2d8c..240b78920 100755 --- a/tests/handover/handover_tests.sh +++ b/tests/handover/handover_tests.sh @@ -19,24 +19,17 @@ one_test() { set +e "$build_dir"/handover_test "$test_path" > "$got_out" 2> "$got_err" rc=$? - if [ "x$rc" = "x0" ]; then - expect_out="$test_path.ok" - expect_err="$test_path.err" - if [ "x$update" = "x-u" ]; then - cp "$got_out" "$expect_out" - cp "$got_err" "$expect_err" - else - if [ -f "$expect_out" ]; then - diff -u "$expect_out" "$got_out" - rc=$? - fi - if [ -f "$expect_err" ]; then - diff -u "$expect_err" "$got_err" - rc2=$? - fi - if [ "x$rc" = "x0" ]; then - rc=$rc2 - fi + expect_out="$test_path.ok" + expect_err="$test_path.err" + if [ "x$rc" = "x0" -a "x$update" = "x-u" ]; then + cp "$got_out" "$expect_out" + cp "$got_err" "$expect_err" + else + if [ -f "$expect_out" ]; then + diff -u "$expect_out" "$got_out" >&2 + fi + if [ -f "$expect_err" ]; then + diff -u "$expect_err" "$got_err" >&2 fi fi rm "$got_out" |