diff --git a/ci/tests/run-gtest-parallel.sh b/ci/tests/run-gtest-parallel.sh index 082197e138..d48abd2cb3 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}" + 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 "$@" + test_status=$? else - echo "gtest-parallel not found at ${GTEST_PARALLEL}, running tests directly for target: ${target}" + 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}" "$@" -fi \ No newline at end of file + 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