From 27a02bc7d10821f5788e4f2752d56e3f7aa19086 Mon Sep 17 00:00:00 2001 From: Valentin Gagarin Date: Mon, 6 May 2024 15:17:27 +0200 Subject: [PATCH] tests: remove unneeded indirection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit the additional function calls obscured the actual logic Co-authored-by: Théophane Hufschmitt <7226587+thufschmitt@users.noreply.github.com> --- mk/common-test.sh | 8 -------- mk/debug-test.sh | 4 ++-- mk/run-test.sh | 4 ++-- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/mk/common-test.sh b/mk/common-test.sh index 2783d293b..2abea7887 100644 --- a/mk/common-test.sh +++ b/mk/common-test.sh @@ -17,11 +17,3 @@ TESTS_ENVIRONMENT=( run () { cd "$(dirname $1)" && env "${TESTS_ENVIRONMENT[@]}" $BASH -x -e -u -o pipefail $(basename $1) } - -init_test () { - run "$init" 2>/dev/null > /dev/null -} - -run_test_proper () { - run "$test" -} diff --git a/mk/debug-test.sh b/mk/debug-test.sh index 52482c01e..1cd6f9dce 100755 --- a/mk/debug-test.sh +++ b/mk/debug-test.sh @@ -9,6 +9,6 @@ dir="$(dirname "${BASH_SOURCE[0]}")" source "$dir/common-test.sh" if [ -n "$init" ]; then - (init_test) + (run "$init" 2>/dev/null > /dev/null) fi -run_test_proper +run "$test" diff --git a/mk/run-test.sh b/mk/run-test.sh index da9c5a473..177a452e8 100755 --- a/mk/run-test.sh +++ b/mk/run-test.sh @@ -23,9 +23,9 @@ fi run_test () { if [ -n "$init" ]; then - (init_test 2>/dev/null > /dev/null) + (run "$init" 2>/dev/null > /dev/null) fi - log="$(run_test_proper 2>&1)" && status=0 || status=$? + log="$(run "$test" 2>&1)" && status=0 || status=$? } run_test