-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathrun_test.sh
executable file
·49 lines (46 loc) · 1.49 KB
/
run_test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env bash
alt_rmw="rmw_opendds_cpp"
run_test="examples_rclcpp_minimal_publisher publisher_member_function"
gdb_cmd="--prefix 'gdb -ex run --args'"
executable_suffix=""
while getopts ":ha:sbe:cSn" opt; do
case ${opt} in
a )
alt_rmw=$OPTARG
echo "NOTE: For optional DDS implementations, only rmw_fastrtps_cpp is installed by default. All others require extra installation steps. https://index.ros.org/doc/ros2/Installation/DDS-Implementations/."
;;
s )
run_test="examples_rclcpp_minimal_subscriber subscriber_member_function"
;;
n )
gdb_cmd=""
;;
b )
gdb_cmd="--prefix 'gdb --args'"
;;
e )
executable_suffix=$OPTARG
;;
c )
run_test="examples_rclcpp_minimal_client client_main"
;;
S )
run_test="examples_rclcpp_minimal_service service_main"
;;
n )
gdb_cmd=""
;;
h ) printf "options:\n [-s] switch to subscriber\n [-a] use alternate rmw (i.e. rmw_cyclonedds_cpp, rmw_fastrtps_cpp, or rmw_connext_cpp).\n [-b] breakpoint debugging\n [-e] run executable suffix such as \"_instrumented\" or \"_no_param_services\"\n [-c] run client\n [-S] run server\n [-n] no debug\n"
exit
;;
esac
done
script=`realpath $0`
script_path=`dirname $script`
pushd $script_path &> /dev/null
pushd .. &> /dev/null
. /opt/ros/foxy/setup.bash
. install/local_setup.bash
eval RMW_IMPLEMENTATION="$alt_rmw ros2 run ${gdb_cmd} $run_test$executable_suffix"
popd &> /dev/null
popd &> /dev/null