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"
22 .
/configure
"$@" $OSX_CONFOPTS
24 if [ "$DUMP_CONFIG_LOG" = "short" ]; then
25 grep -B1 -A10000 "^## Output variables" config.log |
grep -v "_FALSE="
26 elif [ "$DUMP_CONFIG_LOG" = "full" ]; then
32 function check_nonroot
34 local opts
="$MAKE_CHECK_OPTS --show-diff"
37 --disable-use-tty-group \
38 --enable-all-programs \
43 $MAKE check TS_OPTS
="$opts" ||
return
45 $MAKE install DESTDIR
=/tmp
/dest ||
return
50 local opts
="$MAKE_CHECK_OPTS --parallel=1 --show-diff"
53 --enable-all-programs \
57 $MAKE check TS_COMMAND
="true" ||
return
59 sudo
-E $MAKE check TS_OPTS
="$opts" ||
return
61 sudo
$MAKE install ||
return
68 $MAKE distcheck ||
return
71 function travis_install_script
73 if [ "$TRAVIS_OS_NAME" = "osx" ]; then
78 # install some packages from Ubuntu's default sources
79 sudo apt-get
-qq update
80 sudo apt-get
install -qq >/dev
/null \
94 # install only if available (e.g. Ubuntu Trusty)
95 sudo apt-get
install -qq >/dev
/null \
96 libsystemd-daemon-dev \
97 libsystemd-journal-dev \
101 function osx_install_script
103 brew update
>/dev
/null
104 brew tap homebrew
/dupes
106 brew
install gettext ncurses socat xz
107 brew link
--force gettext
108 brew link
--force ncurses
115 # workaround: glibtoolize could not find sed
119 function osx_prepare_check
121 [ "$TRAVIS_OS_NAME" = "osx" ] ||
return 0
123 # these ones only need to be gnu for our test-suite
124 brew
install coreutils findutils gnu-tar gnu-sed
126 # symlink minimally needed gnu commands into PATH
128 for cmd
in readlink
seq truncate
find xargs tar sed; do
129 ln -s /usr
/local
/bin
/g
$cmd $HOME/bin
/$cmd
133 export TS_OPT_col_multibyte_known_fail
=yes
134 export TS_OPT_colcrt_regressions_known_fail
=yes
135 export TS_OPT_column_invalid_multibyte_known_fail
=yes
138 function travis_before_script
149 function travis_script
154 case "$MAKE_CHECK" in
165 echo "error, check environment (travis.yml)" >&2
170 # We exit here with case-switch return value!
176 function travis_after_script
181 # find diff dir from check as well as from distcheck
182 diff_dir
=$
(find .
-type d
-name "diff" |
grep "tests/diff" |
head -n 1)
183 if [ -d "$diff_dir" ]; then
184 tmp
=$
(find "$diff_dir" -type f |
sort)
185 echo -en "dump test diffs:\n${tmp}\n"
186 echo "$tmp" |
xargs cat