diff --git a/ci/tests/run-gtest-parallel.sh b/ci/tests/run-gtest-parallel.sh index 082197e138..9752a41e2b 100755 --- a/ci/tests/run-gtest-parallel.sh +++ b/ci/tests/run-gtest-parallel.sh @@ -3,23 +3,29 @@ set -euo pipefail source "$(dirname "$BASH_SOURCE")/common.sh" -target=$1 -if [ -z "${target-}" ]; then - echo "Target not specified" +executable=$1 +if [ -z "${executable-}" ]; then + echo "Executable not specified" exit 1 fi shift -executable=./${target}$(get_exec_extension) # Get the project root directory (2 levels up from ci/tests) PROJECT_ROOT="$(cd "$(dirname "$BASH_SOURCE")/../.." && pwd)" GTEST_PARALLEL="${PROJECT_ROOT}/submodules/gtest-parallel/gtest-parallel" if [ -f "${GTEST_PARALLEL}" ]; then - echo "Running tests with gtest-parallel for target: ${target}" - "${GTEST_PARALLEL}" "${executable}" --worker=1 "$@" + echo "Running tests with gtest-parallel for executable: ${executable}" + # Redirect stderr to both stderr and a file to capture sanitizer output + "${GTEST_PARALLEL}" "${executable}" --worker=1 "$@" 2> >(tee sanitizer_report.txt >&2) + test_status=$? else - echo "gtest-parallel not found at ${GTEST_PARALLEL}, running tests directly for target: ${target}" - "${executable}" "$@" -fi \ No newline at end of file + echo "gtest-parallel not found at ${GTEST_PARALLEL}, running tests directly for executable: ${executable}" + # Redirect stderr to both stderr and a file to capture sanitizer output + "${executable}" "$@" 2> >(tee sanitizer_report.txt >&2) + test_status=$? +fi + +# Return the original test exit status +exit $test_status \ No newline at end of file diff --git a/ci/tests/run-tests.sh b/ci/tests/run-tests.sh index 4d95f861d4..c322bba26c 100755 --- a/ci/tests/run-tests.sh +++ b/ci/tests/run-tests.sh @@ -46,10 +46,11 @@ case "$(uname -s)" in ;; esac -# Run the test using gtest-parallel helper shift executable=./${target}$(get_exec_extension) -"$(dirname "$BASH_SOURCE")/run-gtest-parallel.sh" "${target}" "$@" + +# Run the test using gtest-parallel helper +"$(dirname "$BASH_SOURCE")/run-gtest-parallel.sh" "${executable}" "$@" status=$? if [ $status -ne 0 ]; then