Skip to content

Commit

Permalink
run tests with gtest-parallel and --worker=1
Browse files Browse the repository at this point in the history
gr0vity committed Dec 7, 2024
1 parent ad5da18 commit 2673c53
Showing 2 changed files with 23 additions and 2 deletions.
21 changes: 21 additions & 0 deletions ci/tests/run-gtest-parallel.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash
set -euo pipefail

source "$(dirname "$BASH_SOURCE")/common.sh"

target=$1
if [ -z "${target-}" ]; then
echo "Target not specified"
exit 1
fi

executable=./${target}$(get_exec_extension)

# Check if gtest-parallel is available
if command -v gtest-parallel >/dev/null 2>&1; then
echo "Running tests with gtest-parallel for target: ${target}"
gtest-parallel "${executable}" --worker=1
else
echo "gtest-parallel not found, running tests directly for target: ${target}"
"${executable}"
fi
4 changes: 2 additions & 2 deletions ci/tests/run-tests.sh
Original file line number Diff line number Diff line change
@@ -46,10 +46,10 @@ case "$(uname -s)" in
;;
esac

# Run the test
# Run the test using gtest-parallel helper
shift
executable=./${target}$(get_exec_extension)
"${executable}" "$@"
"$(dirname "$BASH_SOURCE")/run-gtest-parallel.sh" "${target}" "$@"
status=$?

if [ $status -ne 0 ]; then

0 comments on commit 2673c53

Please sign in to comment.