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 function check_nonroot
41 local opts
="$MAKE_CHECK_OPTS --show-diff"
44 --disable-use-tty-group \
45 --disable-makeinstall-chown \
46 --enable-all-programs \
51 $MAKE check TS_OPTS
="$opts" ||
return
53 $MAKE install DESTDIR
=/tmp
/dest ||
return
58 local opts
="$MAKE_CHECK_OPTS --parallel=1 --show-diff"
61 --enable-all-programs \
65 $MAKE check TS_COMMAND
="true" ||
return
67 sudo
-E $MAKE check TS_OPTS
="$opts" ||
return
69 # keep PATH to make sure sudo would find $CC
70 sudo env
"PATH=$PATH" $MAKE install ||
return
77 $MAKE distcheck ||
return
80 function travis_install_script
82 if [ "$TRAVIS_OS_NAME" = "osx" ]; then
87 # install required packages
88 sudo apt-get
-qq update
--fix-missing
89 sudo apt-get
install -qq >/dev
/null \
103 # install only if available (e.g. Ubuntu Trusty)
104 sudo apt-get
install -qq >/dev
/null \
105 libsystemd-daemon-dev \
106 libsystemd-journal-dev \
110 function osx_install_script
112 brew update
>/dev
/null
113 brew tap homebrew
/dupes
115 brew
install gettext ncurses socat xz
116 brew link
--force gettext
117 brew link
--force ncurses
124 # workaround: glibtoolize could not find sed
128 function osx_prepare_check
130 [ "$TRAVIS_OS_NAME" = "osx" ] ||
return 0
132 # these ones only need to be gnu for our test-suite
133 brew
install coreutils findutils gnu-tar gnu-sed
135 # symlink minimally needed gnu commands into PATH
137 for cmd
in readlink
seq timeout truncate
find xargs tar sed; do
138 ln -s /usr
/local
/bin
/g
$cmd $HOME/bin
/$cmd
142 export TS_OPT_col_multibyte_known_fail
=yes
143 export TS_OPT_colcrt_regressions_known_fail
=yes
144 export TS_OPT_column_invalid_multibyte_known_fail
=yes
147 function travis_before_script
158 function travis_script
163 case "$MAKE_CHECK" in
174 echo "error, check environment (travis.yml)" >&2
179 # We exit here with case-switch return value!
185 function travis_after_script
190 # find diff dir from check as well as from distcheck
191 diff_dir
=$
(find .
-type d
-name "diff" |
grep "tests/diff" |
head -n 1)
192 if [ -d "$diff_dir" ]; then
193 tmp
=$
(find "$diff_dir" -type f |
sort)
194 echo -en "dump test diffs:\n${tmp}\n"
195 echo "$tmp" |
xargs cat