4 # .travis-functions.sh:
5 # - helper functions to be sourced from .travis.yml
6 # - designed to respect travis' environment but testing locally is possible
9 if [ ! -f "configure.ac" ]; then
10 echo ".travis-functions.sh must be sourced from source dir" >&2
14 ## some config settings
15 # travis docs say we get 1.5 CPUs
17 DUMP_CONFIG_LOG
="short"
18 export TS_OPT_parsable
="yes"
20 # workaround ugly warning on travis OSX,
21 # see https://github.com/direnv/direnv/issues/210
22 shell_session_update
() { :; }
29 .
/configure
"$@" $OSX_CONFOPTS
31 if [ "$DUMP_CONFIG_LOG" = "short" ]; then
32 grep -B1 -A10000 "^## Output variables" config.log |
grep -v "_FALSE="
33 elif [ "$DUMP_CONFIG_LOG" = "full" ]; then
39 # TODO: integrate checkusage into our regular tests and remove this function
40 function make_checkusage
43 if ! tmp
=$
($MAKE checkusage
2>&1) ||
test -n "$tmp"; then
45 echo "make checkusage failed" >&2
50 function check_nonroot
52 local opts
="$MAKE_CHECK_OPTS --show-diff"
55 --disable-use-tty-group \
56 --disable-makeinstall-chown \
57 --enable-all-programs \
62 $MAKE check TS_OPTS
="$opts" ||
return
64 make_checkusage ||
return
66 $MAKE install DESTDIR
=/tmp
/dest ||
return
71 local opts
="$MAKE_CHECK_OPTS --parallel=1 --show-diff"
74 --enable-all-programs \
78 $MAKE check TS_COMMAND
="true" ||
return
80 sudo
-E $MAKE check TS_OPTS
="$opts" ||
return
82 # keep PATH to make sure sudo would find $CC
83 sudo env
"PATH=$PATH" $MAKE install ||
return
90 $MAKE distcheck ||
return
93 function travis_install_script
95 if [ "$TRAVIS_OS_NAME" = "osx" ]; then
100 # install required packages
101 sudo apt-get
-qq update
--fix-missing
102 sudo apt-get
install -qq >/dev
/null \
116 # install only if available (e.g. Ubuntu Trusty)
117 sudo apt-get
install -qq >/dev
/null \
118 libsystemd-daemon-dev \
119 libsystemd-journal-dev \
123 function osx_install_script
125 brew update
>/dev
/null
126 brew tap homebrew
/dupes
128 brew
install gettext ncurses socat xz
129 brew link
--force gettext
130 brew link
--force ncurses
137 # workaround: glibtoolize could not find sed
141 function osx_prepare_check
143 [ "$TRAVIS_OS_NAME" = "osx" ] ||
return 0
145 # these ones only need to be gnu for our test-suite
146 brew
install coreutils findutils gnu-tar gnu-sed
148 # symlink minimally needed gnu commands into PATH
150 for cmd
in readlink
seq timeout truncate
find xargs tar sed; do
151 ln -s /usr
/local
/bin
/g
$cmd $HOME/bin
/$cmd
155 export TS_OPT_col_multibyte_known_fail
=yes
156 export TS_OPT_colcrt_regressions_known_fail
=yes
157 export TS_OPT_column_invalid_multibyte_known_fail
=yes
160 function travis_before_script
171 function travis_script
176 case "$MAKE_CHECK" in
187 echo "error, check environment (travis.yml)" >&2
192 # We exit here with case-switch return value!
198 function travis_after_script
203 # find diff dir from check as well as from distcheck
204 diff_dir
=$
(find .
-type d
-name "diff" |
grep "tests/diff" |
head -n 1)
205 if [ -d "$diff_dir" ]; then
206 tmp
=$
(find "$diff_dir" -type f |
sort)
207 echo -en "dump test diffs:\n${tmp}\n"
208 echo "$tmp" |
xargs cat