read -p "Press ENTER to run test 2."
export ROS_DISTRO=
bash scripts/install_dependencies.bash
### Test 1
...
Installing Lanelet2 library from ROS binaries...
...
Installing Lanelet2 library from source for Python3.8...
Configuring Catkin workspace...
...
Successfully installed GeoScenario Server dependencies.
### Test 2
...
Installing Lanelet2 library from ROS binaries...
No ROS distribution was found. Please ensure that setup.bash is sourced.
### Test 3 and Test 4
- Are the cases where the `rosversion` command doesn't exist
- This is hard to simulate, but `! which rosversion > /dev/null` will be true, and so the if-block will be entered (i.e., `No ROS distribution was found. Please ensure that setup.bash is sourced.` will be echoed, and the script will `exit` with an exit status of `1`).
Testing
geoscenarioserver
):read -p "Press ENTER to run test 1."
1. rosversion command exists, rosversion -sd returns "melodic"
export ROS_DISTRO=melodic bash scripts/install_dependencies.bash
2. rosversion command exists, rosversion -sd returns ""
read -p "Press ENTER to run test 2." export ROS_DISTRO= bash scripts/install_dependencies.bash
... Installing Lanelet2 library from ROS binaries... ... Installing Lanelet2 library from source for Python3.8...
Configuring Catkin workspace... ... Successfully installed GeoScenario Server dependencies.
... Installing Lanelet2 library from ROS binaries...
No ROS distribution was found. Please ensure that setup.bash is sourced.