44export DEBIAN_FRONTEND=noninteractive
55
66function travis_time_start {
7- TRAVIS_START_TIME=$( date +%s)
7+ if [ " $TRAVIS_OS_NAME " == " osx" ]; then
8+ TRAVIS_START_TIME=$(( $(date +% s)* 1000000000 ))
9+ else
10+ TRAVIS_START_TIME=$( date +%s%N)
11+ fi
812 TRAVIS_TIME_ID=$( cat /dev/urandom | LC_ALL=C LC_CTYPE=C tr -dc ' a-z0-9' | fold -w 8 | head -n 1)
913 TRAVIS_FOLD_NAME=$1
1014 echo -e " \e[0Ktravis_fold:start:$TRAVIS_FOLD_NAME "
@@ -14,7 +18,11 @@ function travis_time_start {
1418function travis_time_end {
1519 set +x # disable debug information
1620 _COLOR=${1:- 32}
17- TRAVIS_END_TIME=$( date +%s)
21+ if [ " $TRAVIS_OS_NAME " == " osx" ]; then
22+ TRAVIS_END_TIME=$(( $(date +% s)* 1000000000 ))
23+ else
24+ TRAVIS_END_TIME=$( date +%s%N)
25+ fi
1826 TIME_ELAPSED_SECONDS=$(( ($TRAVIS_END_TIME - $TRAVIS_START_TIME )/ 1000000000 ))
1927 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"
2028 echo -e " travis_fold:end:$TRAVIS_FOLD_NAME "
@@ -28,7 +36,9 @@ if [ "$TRAVIS_OS_NAME" == "linux" ]; then
2836 travis_time_end
2937
3038 travis_time_start setup.apt-get_install
31- ret=1; while [ $ret != 0 ]; do sudo apt-get install -qq -y git make gcc g++ libjpeg-dev libxext-dev libx11-dev libgl1-mesa-dev libglu1-mesa-dev libpq-dev libpng-dev xfonts-100dpi xfonts-75dpi && ret=0 || echo " failed, retry" ; done # msttcorefonts could not install on 14.04 travis
39+ ret=1; while [ $ret != 0 ]; do sudo apt-get install -qq -y git make gcc g++ libjpeg-dev libxext-dev libx11-dev libgl1-mesa-dev libglu1-mesa-dev libpq-dev libpng-dev xfonts-100dpi xfonts-75dpi pkg-config libbullet-dev && ret=0 || echo " failed, retry" ; done # msttcorefonts could not install on 14.04 travis
40+ # unset protocol version https://github.com/juju/charm-tools/issues/532
41+ git config --global --unset protocol.version || echo " OK"
3242 if [ " ` uname -m` " == " x86_64" ] ; then sudo apt-get install -qq -y texlive-latex-base ptex-bin latex2html nkf poppler-utils || echo " ok" ; fi # 16.04 does ont have ptex bin
3343 travis_time_end
3444
@@ -38,16 +48,93 @@ if [ "$TRAVIS_OS_NAME" == "osx" ]; then
3848 # skip if already installed
3949 # https://discourse.brew.sh/t/skip-ignore-brew-install-if-package-is-already-installed/633/2
4050 # brew install jpeg libpng mesalib-glw;
41- brew list jpeg & > /dev/null || brew install jpeg
42- brew list libpng & > /dev/null || brew install libpng
43- brew list mesalib-glw & > /dev/null || brew install mesalib-glw
51+ # use HOMEBREW_NO_AUT_UPDATE to fix unexpected keyword error https://travis-ci.community/t/syntax-error-unexpected-keyword-rescue-expecting-keyword-end-in-homebrew/5623
52+ brew list jpeg & > /dev/null || HOMEBREW_NO_AUTO_UPDATE=1 brew install jpeg
53+ brew list libpng & > /dev/null || HOMEBREW_NO_AUTO_UPDATE=1 brew install libpng
54+ brew list mesalib-glw & > /dev/null || HOMEBREW_NO_AUTO_UPDATE=1 brew install mesalib-glw
55+ brew list bullet & > /dev/null || HOMEBREW_NO_AUTO_UPDATE=1 brew install bullet
4456 travis_time_end
4557
4658fi
4759
60+ # ## for multiarch compile test
61+ if [ " $QEMU " != " " ]; then
62+ travis_time_start install.dpkg-dev
63+ apt-get install -qq -y dpkg-dev
64+ travis_time_end
65+
66+ echo " uname -a : $( uname -a) "
67+ echo " uname -m : $( uname -m) "
68+ echo " gcc -dumpmachine : $( gcc -dumpmachine) "
69+ echo " gcc -dumpversion : $( gcc -dumpversion) "
70+ echo " getconf LONG_BIT : $( getconf LONG_BIT) "
71+
72+ travis_time_start compile.euslisp
73+ export EUSDIR=` pwd`
74+ eval " $( dpkg-buildflags --export=sh) "
75+ make -C lisp -f Makefile.Linux eus0 eus1 eus2 eusg eusx eusgl eus eusjpeg
76+ travis_time_end
77+
78+ if [[ ` gcc -dumpmachine | egrep " ^(arm|aarch)" ` != " " ]]; then
79+ export ARCHDIR=LinuxARM
80+ elif [[ ` gcc -dumpmachine | egrep " ^x86_64" ` != " " ]]; then
81+ export ARCHDIR=Linux64
82+ else
83+ export ARCHDIR=Linux
84+ fi
85+ export PATH=` pwd` /$ARCHDIR /bin:$PATH
86+
87+ export EXIT_STATUS=0;
88+ set +e
89+ # run test in EusLisp/test
90+ for test_l in test/* .l; do
91+
92+ travis_time_start euslisp.${test_l##*/ } .test
93+
94+ sed -i ' s/\(i-max\ [0-9]000\)0*/\1/' $test_l
95+
96+ eusgl $test_l ;
97+ export TMP_EXIT_STATUS=$?
98+
99+ travis_time_end ` expr 32 - $TMP_EXIT_STATUS `
100+
101+ export EXIT_STATUS=` expr $TMP_EXIT_STATUS + $EXIT_STATUS ` ;
102+
103+ travis_time_start compiled.${test_l##*/ } .test
104+
105+ 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))))"
106+ export TMP_EXIT_STATUS=$?
107+
108+ export CONTINUE=0
109+ # const.l does not compilable https://github.com/euslisp/EusLisp/issues/318
110+ if [[ $test_l =~ const.l ]]; then export CONTINUE=1; fi
111+
112+ if [[ $CONTINUE == 0 ]]; then travis_time_end ` expr 32 - $TMP_EXIT_STATUS ` ; else travis_time_end 33; fi
113+
114+ if [[ $TMP_EXIT_STATUS != 0 ]]; then echo " Failed running $test_l . Exiting with $TMP_EXIT_STATUS " ; fi
115+
116+ if [[ $CONTINUE != 0 ]]; then continue ; fi
117+
118+ export EXIT_STATUS=` expr $TMP_EXIT_STATUS + $EXIT_STATUS ` ;
119+ done ;
120+ echo " Exit status : $EXIT_STATUS " ;
121+
122+ travis_time_start euslisp.eusjpeg.test
123+
124+ eusgl ' (progn (load (format nil "~A/lisp/image/jpeg/eusjpeg.l" *eusdir*))(image::write-jpeg-file "test.jpg" (instance color-image24 :init 100 100)) (print *user*) (unix::exit))'
125+
126+ export TMP_EXIT_STATUS=$?
127+
128+ travis_time_end ` expr 32 - $TMP_EXIT_STATUS `
129+ export EXIT_STATUS=` expr $TMP_EXIT_STATUS + $EXIT_STATUS ` ;
130+ echo " Exit status : $EXIT_STATUS " ;
131+ [ $EXIT_STATUS == 0 ] || exit 1
132+ exit 0
133+ fi
134+
48135travis_time_start install # Use this to install any prerequisites or dependencies necessary to run your build
49136cd ${HOME}
50- [ -e jskeus ] || git clone http://github.com/euslisp/jskeus jskeus
137+ [ -e jskeus ] || git clone --depth 1 http://github.com/euslisp/jskeus jskeus
51138ln -s $CI_SOURCE_PATH jskeus/eus
52139ln -s ` pwd` /jskeus/irteus jskeus/eus/irteus
53140travis_time_end
@@ -59,8 +146,21 @@ if [[ "$DOCKER_IMAGE" == *"trusty"* || "$DOCKER_IMAGE" == *"jessie"* ]]; then
59146else
60147 make eus-installed WFLAGS=" -Werror=implicit-int -Werror=implicit-function-declaration -Werror=incompatible-pointer-types -Werror=int-conversion -Werror=unused-result"
61148fi
149+ travis_time_end
150+
151+ travis_time_start script.make.jskeus
152+
62153make
63154
155+ travis_time_end
156+
157+ travis_time_start script.eustag
158+
159+ (cd eus/lisp/tool; make)
160+
161+ travis_time_end
162+
163+
64164travis_time_end
65165
66166if [ " $TRAVIS_OS_NAME " == " linux" -a " ` uname -m` " == " x86_64" -a " $ROS_DISTRO " != " " ]; then
145245
146246 travis_time_end ` expr 32 - $TMP_EXIT_STATUS `
147247
248+ if [[ $TMP_EXIT_STATUS != 0 ]]; then echo " Failed running $test_l . Exiting with $TMP_EXIT_STATUS " ; fi
249+
148250 export EXIT_STATUS=` expr $TMP_EXIT_STATUS + $EXIT_STATUS ` ;
149251 done ;
150252 echo " Exit status : $EXIT_STATUS " ;
151253
152254
153255 # run test in compiled EusLisp/test
154256 for test_l in $CI_SOURCE_PATH /test/* .l; do
155- # bignum test fails on armhf
156- [[ " ` uname -m` " == " arm" * && $test_l =~ bignum.l ]] && continue ;
157- # const.l does not compilable https://github.com/euslisp/EusLisp/issues/318
158- [[ $test_l =~ const.l ]] && continue ;
159257
160258 travis_time_start compiled.${test_l##*/ } .test
161259
162260 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))))"
163261 export TMP_EXIT_STATUS=$?
164262
165- travis_time_end ` expr 32 - $TMP_EXIT_STATUS `
263+ export CONTINUE=0
264+ # const.l does not compilable https://github.com/euslisp/EusLisp/issues/318
265+ if [[ $test_l =~ const.l ]]; then export CONTINUE=1; fi
266+
267+ if [[ $CONTINUE == 0 ]]; then travis_time_end ` expr 32 - $TMP_EXIT_STATUS ` ; else travis_time_end 33; fi
268+
269+ if [[ $TMP_EXIT_STATUS != 0 ]]; then echo " Failed running $test_l . Exiting with $TMP_EXIT_STATUS " ; fi
270+
271+ if [[ $CONTINUE != 0 ]]; then continue ; fi
166272
167273 export EXIT_STATUS=` expr $TMP_EXIT_STATUS + $EXIT_STATUS ` ;
168274 done ;
171277 # run test in jskeus/irteus
172278 for test_l in irteus/test/* .l; do
173279
174- [[ (" ` 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 ;
175-
176280 travis_time_start irteus.${test_l##*/ } .test
177281
178282 irteusgl $test_l ;
179283 export TMP_EXIT_STATUS=$?
180284
181- travis_time_end ` expr 32 - $TMP_EXIT_STATUS `
285+ export CONTINUE=0
286+ # skip collision test because bullet of 2.83 or later version is not released in trusty and jessie.
287+ # https://github.com/euslisp/jskeus/blob/6cb08aa6c66fa8759591de25b7da68baf76d5f09/irteus/Makefile#L37
288+ if [[ ( " $DOCKER_IMAGE " == * " trusty" * || " $DOCKER_IMAGE " == * " jessie" * ) && $test_l =~ test-collision.l ]]; then export CONTINUE=1; fi
289+
290+ if [[ $CONTINUE == 0 ]]; then travis_time_end ` expr 32 - $TMP_EXIT_STATUS ` ; else travis_time_end 33; fi
291+
292+ if [[ $TMP_EXIT_STATUS != 0 ]]; then echo " Failed running $test_l . Exiting with $TMP_EXIT_STATUS " ; fi
293+
294+ if [[ $CONTINUE != 0 ]]; then continue ; fi
182295
183296 export EXIT_STATUS=` expr $TMP_EXIT_STATUS + $EXIT_STATUS ` ;
184297 done ;
0 commit comments