diff --git a/install_ubuntu_common.bash b/install_ubuntu_common.bash index 4e20620..a545a20 100755 --- a/install_ubuntu_common.bash +++ b/install_ubuntu_common.bash @@ -98,16 +98,6 @@ function ubuntu_set_autostart() { #TODO test, exception handling } -function _test_commands() { - RESULT=0 # success by default - - bloom-release --help || RESULT=1 - catkin --help || RESULT=1 - rosdep --help || RESULT=1 - wstool --help || RESULT=1 - return $RESULT -} - function install_docker() { RESULT=0 # success by default @@ -289,4 +279,4 @@ install_oraclejava install_eclipse # Test some commands to check installation -_test_systems +source $CI_SOURCE_PATH/test/test_install.sh diff --git a/test/test_install.sh b/test/test_install.sh new file mode 100755 index 0000000..6ebfa7b --- /dev/null +++ b/test/test_install.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +function _test_commands() { + RESULT=0 # success by default + + bloom-release --help || RESULT=1 + catkin --help || RESULT=1 + rosdep --help || RESULT=1 + wstool --help || RESULT=1 + return $RESULT +} + +# Need to test https://github.com/130s/compenv_ubuntu/issues/3 +function test_display_env() { + #TODO + return +} + +function _test_systems() { + + _test_commands + retval_test_commands=$? + if [ $retval_test_commands -ne 0 ]; then echo "Error: not all commands are installed yet. Exiting.o"; exit 1; fi + + if [ ! -z $MSG_ENDROLL ]; then printf $MSG_ENDROLL; else echo "Script ends."; fi + + test_display_env +} + +# Here's kindf of main function. +_test_systems