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 authored and olgaakulinushkina committed Oct 30, 2024
1 parent b749e41 commit aa07b24
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 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
15 changes: 7 additions & 8 deletions tools/test-fwe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,25 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

set -eo pipefail
set -efo 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 " --with-ros2-support Test with ROS2 support"
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 aa07b24

Please sign in to comment.