From fd547fe790751af9241a293a89db5d5316d93387 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Wo=CC=81jcik?= <3044353+pwojcikdev@users.noreply.github.com> Date: Sun, 11 Feb 2024 18:39:14 +0100 Subject: [PATCH] SHOW CORE DUMPS #3 --- ci/tests/run-core-tests.sh | 24 ++---------------------- ci/tests/run-qt-tests.sh | 6 +----- ci/tests/run-rpc-tests.sh | 6 +----- ci/tests/run-tests.sh | 25 +++++++++++++++++++++++++ 4 files changed, 29 insertions(+), 32 deletions(-) create mode 100755 ci/tests/run-tests.sh diff --git a/ci/tests/run-core-tests.sh b/ci/tests/run-core-tests.sh index b35fb4006b..31dd324a3f 100755 --- a/ci/tests/run-core-tests.sh +++ b/ci/tests/run-core-tests.sh @@ -1,24 +1,4 @@ #!/bin/bash -set -uo pipefail +set -euo pipefail -source "$(dirname "$BASH_SOURCE")/common.sh" - -enable_core_dumps - -BUILD_DIR=${1-${PWD}} - -executable=${BUILD_DIR}/core_test$(get_exec_extension) -"${executable}" -status=$? - -if [ $status -ne 0 ]; then - echo "Test failed" - - # Show core dumps - export EXECUTABLE=${executable} - "$(dirname "$BASH_SOURCE")/show-core-dumps.sh" - - exit $status -else - exit 0 -fi \ No newline at end of file +$(dirname "$BASH_SOURCE")/run-tests.sh core_test \ No newline at end of file diff --git a/ci/tests/run-qt-tests.sh b/ci/tests/run-qt-tests.sh index 8faa28d43a..c53b77544c 100755 --- a/ci/tests/run-qt-tests.sh +++ b/ci/tests/run-qt-tests.sh @@ -1,10 +1,6 @@ #!/bin/bash set -euo pipefail -source "$(dirname "$BASH_SOURCE")/common.sh" - -BUILD_DIR=${1-${PWD}} - # Alpine doesn't offer an xvfb xvfb_run_() { @@ -20,4 +16,4 @@ xvfb_run_() return ${res} } -xvfb_run_ ${BUILD_DIR}/qt_test$(get_exec_extension) \ No newline at end of file +xvfb_run_ $(dirname "$BASH_SOURCE")/run-tests.sh qt_test \ No newline at end of file diff --git a/ci/tests/run-rpc-tests.sh b/ci/tests/run-rpc-tests.sh index 6b64607d95..91dba35e71 100755 --- a/ci/tests/run-rpc-tests.sh +++ b/ci/tests/run-rpc-tests.sh @@ -1,8 +1,4 @@ #!/bin/bash set -euo pipefail -source "$(dirname "$BASH_SOURCE")/common.sh" - -BUILD_DIR=${1-${PWD}} - -${BUILD_DIR}/rpc_test$(get_exec_extension) \ No newline at end of file +$(dirname "$BASH_SOURCE")/run-tests.sh rpc_test \ No newline at end of file diff --git a/ci/tests/run-tests.sh b/ci/tests/run-tests.sh new file mode 100755 index 0000000000..015dad713f --- /dev/null +++ b/ci/tests/run-tests.sh @@ -0,0 +1,25 @@ +#!/bin/bash +set -uo pipefail + +source "$(dirname "$BASH_SOURCE")/common.sh" + +enable_core_dumps + +TARGET=$1 +echo "Running tests for target: ${TARGET}" + +executable=${BUILD_DIR}/${TARGET}$(get_exec_extension) +"${executable}" +status=$? + +if [ $status -ne 0 ]; then + echo "Test failed" + + # Show core dumps + export EXECUTABLE=${executable} + "$(dirname "$BASH_SOURCE")/show-core-dumps.sh" + + exit $status +else + exit 0 +fi \ No newline at end of file