diff --git a/ci/tests/common.sh b/ci/tests/common.sh index 293bd0bdfc..350f3bdcfa 100644 --- a/ci/tests/common.sh +++ b/ci/tests/common.sh @@ -15,35 +15,3 @@ get_exec_extension() { esac } -enable_core_dumps() { - COREDUMP_DIR="/cores" - - case "$(uname -s)" in - Linux*) - # Ensure directory exists and is writable for core dumps - sudo mkdir -p "${COREDUMP_DIR}" - sudo chmod a+w "${COREDUMP_DIR}" - - # Enable core dumps - ulimit -c unlimited - echo "${COREDUMP_DIR}/core-%e.%p" | sudo tee /proc/sys/kernel/core_pattern - - export COREDUMP_DIR=${COREDUMP_DIR} - echo "COREDUMP_DIR=${COREDUMP_DIR}" >> $GITHUB_ENV - ;; - Darwin*) - ulimit -c unlimited - - # By default, macOS writes core dumps to /cores - export COREDUMP_DIR=${COREDUMP_DIR} - echo "COREDUMP_DIR=${COREDUMP_DIR}" >> $GITHUB_ENV - ;; - CYGWIN*|MINGW32*|MSYS*|MINGW*) - # TODO: Support core dumps on Windows - ;; - *) - echo "Unknown OS" - exit 1 - ;; - esac -} \ No newline at end of file diff --git a/ci/tests/run-tests.sh b/ci/tests/run-tests.sh index 015dad713f..a32614e330 100755 --- a/ci/tests/run-tests.sh +++ b/ci/tests/run-tests.sh @@ -3,12 +3,48 @@ set -uo pipefail source "$(dirname "$BASH_SOURCE")/common.sh" +enable_core_dumps() { + COREDUMP_DIR="/cores" + + case "$(uname -s)" in + Linux*) + # Ensure directory exists and is writable for core dumps + sudo mkdir -p "${COREDUMP_DIR}" + sudo chmod a+w "${COREDUMP_DIR}" + + # Enable core dumps + ulimit -c unlimited + echo "${COREDUMP_DIR}/core-%e.%p" | sudo tee /proc/sys/kernel/core_pattern + + export COREDUMP_DIR=${COREDUMP_DIR} + + echo "Core dumps enabled (Linux)" + ;; + Darwin*) + ulimit -c unlimited + + # By default, macOS writes core dumps to /cores + export COREDUMP_DIR=${COREDUMP_DIR} + + echo "Core dumps enabled (macOS)" + ;; + CYGWIN*|MINGW32*|MSYS*|MINGW*) + # TODO: Support core dumps on Windows + echo "Core dumps not supported on Windows" + ;; + *) + echo "Unknown OS" + exit 1 + ;; + esac +} + enable_core_dumps TARGET=$1 echo "Running tests for target: ${TARGET}" -executable=${BUILD_DIR}/${TARGET}$(get_exec_extension) +executable=./${TARGET}$(get_exec_extension) "${executable}" status=$?