|
1 | 1 | #!/bin/bash
|
2 | 2 |
|
3 | 3 | set -e
|
| 4 | +export DEBIAN_FRONTEND=noninteractive |
4 | 5 |
|
5 | 6 | function travis_time_start {
|
6 |
| - set +x |
7 |
| - TRAVIS_START_TIME=$(date +%s%N) |
8 |
| - TRAVIS_TIME_ID=$(cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 8 | head -n 1) |
| 7 | + TRAVIS_START_TIME=$(date +%s) |
| 8 | + TRAVIS_TIME_ID=$(cat /dev/urandom | LC_ALL=C LC_CTYPE=C tr -dc 'a-z0-9' | fold -w 8 | head -n 1) |
9 | 9 | TRAVIS_FOLD_NAME=$1
|
10 |
| - echo -e "\e[0Ktraivs_fold:start:$TRAVIS_FOLD_NAME" |
11 |
| - echo -e "\e[0Ktraivs_time:start:$TRAVIS_TIME_ID" |
12 |
| - set -x |
| 10 | + echo -e "\e[0Ktravis_fold:start:$TRAVIS_FOLD_NAME" |
| 11 | + echo -e "\e[0Ktravis_time:start:$TRAVIS_TIME_ID" |
| 12 | + set -x # enable debug information |
13 | 13 | }
|
14 | 14 | function travis_time_end {
|
15 |
| - set +x |
| 15 | + set +x # disable debug information |
16 | 16 | _COLOR=${1:-32}
|
17 |
| - TRAVIS_END_TIME=$(date +%s%N) |
| 17 | + TRAVIS_END_TIME=$(date +%s) |
18 | 18 | TIME_ELAPSED_SECONDS=$(( ($TRAVIS_END_TIME - $TRAVIS_START_TIME)/1000000000 ))
|
19 |
| - echo -e "traivs_time:end:$TRAVIS_TIME_ID:start=$TRAVIS_START_TIME,finish=$TRAVIS_END_TIME,duration=$(($TRAVIS_END_TIME - $TRAVIS_START_TIME))\n\e[0K" |
20 |
| - echo -e "traivs_fold:end:$TRAVIS_FOLD_NAME" |
| 19 | + echo -e "travis_time:end:$TRAVIS_TIME_ID:start=$TRAVIS_START_TIME,finish=$TRAVIS_END_TIME,duration=$(($TRAVIS_END_TIME - $TRAVIS_START_TIME))\n\e[0K" |
| 20 | + echo -e "travis_fold:end:$TRAVIS_FOLD_NAME" |
21 | 21 | echo -e "\e[0K\e[${_COLOR}mFunction $TRAVIS_FOLD_NAME takes $(( $TIME_ELAPSED_SECONDS / 60 )) min $(( $TIME_ELAPSED_SECONDS % 60 )) sec\e[0m"
|
22 |
| - set -x |
23 | 22 | }
|
24 | 23 |
|
25 | 24 | if [ "$TRAVIS_OS_NAME" == "linux" ]; then
|
@@ -55,20 +54,140 @@ travis_time_end
|
55 | 54 |
|
56 | 55 | travis_time_start script.make # All commands must exit with code 0 on success. Anything else is considered failure.
|
57 | 56 | cd jskeus
|
| 57 | +if [[ "$DOCKER_IMAGE" == *"trusty"* || "$DOCKER_IMAGE" == *"jessie"* ]]; then |
| 58 | + make eus-installed WFLAGS="-Werror=implicit-int -Werror=implicit-function-declaration -Werror=unused-result" |
| 59 | +else |
| 60 | + make eus-installed WFLAGS="-Werror=implicit-int -Werror=implicit-function-declaration -Werror=incompatible-pointer-types -Werror=int-conversion -Werror=unused-result" |
| 61 | +fi |
58 | 62 | make
|
59 | 63 |
|
60 | 64 | travis_time_end
|
61 |
| -travis_time_start script.test |
| 65 | + |
| 66 | +if [ "$TRAVIS_OS_NAME" == "linux" -a "`uname -m`" == "x86_64" -a "$ROS_DISTRO" != "" ]; then |
| 67 | + |
| 68 | + travis_time_start setup.ros |
| 69 | + |
| 70 | + export TZ=Asia/Tokyo |
| 71 | + echo "${TZ}" > /etc/timezone |
| 72 | + apt-get install -qq -y lsb-release gnupg |
| 73 | + sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' |
| 74 | + ret=1; while [ $ret != 0 ]; do apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116 && ret=0; done |
| 75 | + apt-get update -qq |
| 76 | + apt-get install -qq -y wget python-rosdep python-wstool python-catkin-tools ros-$ROS_DISTRO-rosbash ros-$ROS_DISTRO-rospack |
| 77 | + mkdir -p ~/ws/src |
| 78 | + cd ~/ws/src |
| 79 | + |
| 80 | + travis_time_end |
| 81 | + travis_time_start setup.workspace |
| 82 | + |
| 83 | + # setup roseus |
| 84 | + git clone http://github.com/jsk-ros-pkg/jsk_roseus |
| 85 | + # setup euslisp |
| 86 | + ln -sf ~/jskeus/eus ./euslisp |
| 87 | + wget https://raw.githubusercontent.com/tork-a/euslisp-release/release/kinetic/euslisp/package.xml -O euslisp/package.xml |
| 88 | + mkdir -p euslisp/cmake euslisp/env-hooks |
| 89 | + for file in CMakeLists.txt cmake/euslisp-extras.cmake.in env-hooks/99.euslisp.sh.in; do |
| 90 | + wget https://raw.githubusercontent.com/tork-a/euslisp-release/master/patches/${file} -O euslisp/${file} |
| 91 | + done |
| 92 | + # setup jskeus |
| 93 | + mkdir jskeus |
| 94 | + ln -sf ~/jskeus/irteus ./jskeus/irteus |
| 95 | + cp -r ~/jskeus/doc ~/jskeus/images ./jskeus/ |
| 96 | + wget https://raw.githubusercontent.com/tork-a/jskeus-release/release/$ROS_DISTRO/jskeus/package.xml -O jskeus/package.xml |
| 97 | + wget https://raw.githubusercontent.com/tork-a/jskeus-release/master/patches/CMakeLists.txt -O jskeus/CMakeLists.txt |
| 98 | + # |
| 99 | + travis_time_end |
| 100 | + travis_time_start rosdep.update |
| 101 | + |
| 102 | + cd ~/ws |
| 103 | + source /opt/ros/$ROS_DISTRO/setup.bash |
| 104 | + sudo rosdep init |
| 105 | + rosdep update |
| 106 | + rosdep install -y -q -r --from-paths ./src --ignore-src |
| 107 | + |
| 108 | + travis_time_end |
| 109 | + travis_time_start compile.roseus |
| 110 | + |
| 111 | + catkin build roseus |
| 112 | + |
| 113 | + travis_time_end |
| 114 | + travis_time_start run_tests.roseus |
| 115 | + |
| 116 | + catkin run_tests -p1 -j1 roseus |
| 117 | + source devel/setup.bash |
| 118 | + rospack find roseus |
| 119 | + (roscd roseus; rostest -t test/test-roseus.test) |
| 120 | + catkin_test_results --verbose --all build |
| 121 | + |
| 122 | + travis_time_end |
| 123 | + |
| 124 | + exit 0 |
| 125 | +fi |
62 | 126 |
|
63 | 127 | source bashrc.eus
|
64 | 128 | export DISPLAY=
|
| 129 | +export EXIT_STATUS=0; |
65 | 130 | set +e
|
66 |
| -if [[ "`uname -m`" == "arm"* || "`uname -m`" == "aarch"* ]]; then |
67 |
| - export EXIT_STATUS=0; for test_l in irteus/test/*.l; do [[ $test_l =~ geo.l|interpolator.l|irteus-demo.l|test-irt-motion.l|object.l|coords.l|bignum.l|mathtest.l ]] && continue; irteusgl $test_l; export EXIT_STATUS=`expr $? + $EXIT_STATUS`; done;echo "Exit status : $EXIT_STATUS"; [ $EXIT_STATUS == 0 ] || exit 1 |
68 |
| -else |
69 |
| - export EXIT_STATUS=0; for test_l in irteus/test/*.l; do irteusgl $test_l; export EXIT_STATUS=`expr $? + $EXIT_STATUS`; done;echo "Exit status : $EXIT_STATUS"; [ $EXIT_STATUS == 0 ] || exit 1 |
| 131 | + |
| 132 | +# arm target (ubuntu_arm64/trusty) takes too long time (>50min) for test |
| 133 | +if [[ "`uname -m`" == "aarch"* ]]; then |
| 134 | + sed -i 's@00000@0000@' $CI_SOURCE_PATH/test/object.l $CI_SOURCE_PATH/test/coords.l |
70 | 135 | fi
|
71 | 136 |
|
| 137 | + # run test in EusLisp/test |
| 138 | + for test_l in $CI_SOURCE_PATH/test/*.l; do |
| 139 | + |
| 140 | + travis_time_start euslisp.${test_l##*/}.test |
| 141 | + |
| 142 | + eusgl $test_l; |
| 143 | + export TMP_EXIT_STATUS=$? |
| 144 | + |
| 145 | + travis_time_end `expr 32 - $TMP_EXIT_STATUS` |
| 146 | + |
| 147 | + export EXIT_STATUS=`expr $TMP_EXIT_STATUS + $EXIT_STATUS`; |
| 148 | + done; |
| 149 | + echo "Exit status : $EXIT_STATUS"; |
| 150 | + |
| 151 | + |
| 152 | + # run test in compiled EusLisp/test |
| 153 | + for test_l in $CI_SOURCE_PATH/test/*.l; do |
| 154 | + # bignum test fails on armhf |
| 155 | + [[ "`uname -m`" == "arm"* && $test_l =~ bignum.l ]] && continue; |
| 156 | + # const.l does not compilable https://github.com/euslisp/EusLisp/issues/318 |
| 157 | + [[ $test_l =~ const.l ]] && continue; |
| 158 | + |
| 159 | + travis_time_start compiled.${test_l##*/}.test |
| 160 | + |
| 161 | + eusgl "(let ((o (namestring (merge-pathnames \".o\" \"$test_l\"))) (so (namestring (merge-pathnames \".so\" \"$test_l\")))) (compile-file \"$test_l\" :o o) (if (probe-file so) (load so) (exit 1))))" |
| 162 | + export TMP_EXIT_STATUS=$? |
| 163 | + |
| 164 | + travis_time_end `expr 32 - $TMP_EXIT_STATUS` |
| 165 | + |
| 166 | + export EXIT_STATUS=`expr $TMP_EXIT_STATUS + $EXIT_STATUS`; |
| 167 | + done; |
| 168 | + echo "Exit status : $EXIT_STATUS"; |
| 169 | + |
| 170 | + # run test in jskeus/irteus |
| 171 | + for test_l in irteus/test/*.l; do |
| 172 | + |
| 173 | + [[ ("`uname -m`" == "arm"* || "`uname -m`" == "aarch"*) && $test_l =~ geo.l|mathtest.l|interpolator.l|test-irt-motion.l|test-pointcloud.l|irteus-demo.l ]] && continue; |
| 174 | + |
| 175 | + travis_time_start irteus.${test_l##*/}.test |
| 176 | + |
| 177 | + irteusgl $test_l; |
| 178 | + export TMP_EXIT_STATUS=$? |
| 179 | + |
| 180 | + travis_time_end `expr 32 - $TMP_EXIT_STATUS` |
| 181 | + |
| 182 | + export EXIT_STATUS=`expr $TMP_EXIT_STATUS + $EXIT_STATUS`; |
| 183 | + done; |
| 184 | + echo "Exit status : $EXIT_STATUS"; |
| 185 | + |
| 186 | + |
| 187 | +[ $EXIT_STATUS == 0 ] || exit 1 |
| 188 | + |
| 189 | +travis_time_start eus64.test |
| 190 | + |
72 | 191 | if [[ "$TRAVIS_OS_NAME" == "osx" || "`uname -m`" == "arm"* ]]; then
|
73 | 192 | uname -a
|
74 | 193 | else
|
|
0 commit comments