Skip to content

Commit

Permalink
Fix gtest exclude filter for GH job
Browse files Browse the repository at this point in the history
  • Loading branch information
Olga Akulinushkina committed Oct 30, 2024
1 parent 6064ed1 commit 755040d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/template/fwe-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ runs:
shell: bash
if: inputs.build-arch == 'native'
run: |
./tools/test-fwe.sh ${{ inputs.extra-options }} --extra-ctest-args "-E \"CANDataSourceTest|ISOTPOverCANProtocolTest|IoTFleetWiseEngineTest|OBDOverCANModuleTest\""
./tools/test-fwe.sh ${{ inputs.extra-options }} --extra-gtest-filter "-*CANDataSourceTest*:*ISOTPOverCANProtocolTest*:*IoTFleetWiseEngineTest*:*OBDOverCANModuleTest*"
- name: upload-artifacts
uses: actions/upload-artifact@v4
Expand Down
11 changes: 5 additions & 6 deletions tools/test-fwe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,22 @@
set -eo pipefail

WITH_ROS2_SUPPORT="false"
EXTRA_CTEST_ARGS=""
EXTRA_GTEST_FILTER="*"

parse_args() {
while [ "$#" -gt 0 ]; do
case $1 in
--with-ros2-support)
WITH_ROS2_SUPPORT="true"
shift
;;
--extra-ctest-args)
EXTRA_CTEST_ARGS=$2
--extra-gtest-filter)
EXTRA_GTEST_FILTER=$2
shift
;;
--help)
echo "Usage: $0 [OPTION]"
echo " --with-ros2-support Test with ROS2 support"
echo " --extra-ctest-args Args to be passed to ctest eg. -E <tests to skip>"
echo " --extra-gtest-filter Regex to set for gtest filter eg. '-*<tests to skip>*' or '*<tests to execute>*'"
exit 0
;;
esac
Expand All @@ -37,4 +36,4 @@ if ${WITH_ROS2_SUPPORT}; then
else
cd build
fi
ctest -V ${EXTRA_CTEST_ARGS}
GTEST_FILTER=${EXTRA_GTEST_FILTER} ctest -V

0 comments on commit 755040d

Please sign in to comment.