Skip to content

Commit

Permalink
Merge pull request #59 from 130s/impr/separate_test
Browse files Browse the repository at this point in the history
Separate test code.
  • Loading branch information
130s authored Jul 9, 2016
2 parents a130f19 + aadd826 commit e2ab310
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 11 deletions.
12 changes: 1 addition & 11 deletions install_ubuntu_common.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -289,4 +279,4 @@ install_oraclejava
install_eclipse

# Test some commands to check installation
_test_systems
source $CI_SOURCE_PATH/test/test_install.sh
31 changes: 31 additions & 0 deletions test/test_install.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit e2ab310

Please sign in to comment.