]>
git.ipfire.org Git - thirdparty/util-linux.git/blob - .travis-functions.sh
bbfdf1f13bcdf16579c8cd386a4b000b1634a2a7
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
16 DUMP_CONFIG_LOG
="short"
18 # We could test (exotic) out-of-tree build dirs using relative or abs paths.
19 # After sourcing this script we are living in build dir. Tasks for source dir
20 # have to use $SOURCE_DIR.
23 CONFIGURE
="$SOURCE_DIR/configure"
26 cd "$BUILD_DIR" ||
return 1 ||
exit 1
28 function configure_travis
32 if [ "$DUMP_CONFIG_LOG" = "short" ]; then
33 grep -B1 -A10000 "^## Output variables" config.log |
grep -v "_FALSE="
34 elif [ "$DUMP_CONFIG_LOG" = "full" ]; then
40 function check_nonroot
42 local opts
="$MAKE_CHECK_OPTS"
45 --disable-use-tty-group \
47 --enable-all-programs \
51 $MAKE check TS_OPTS
="$opts" ||
return
52 $MAKE install DESTDIR
=/tmp
/dest ||
return
57 local opts
="$MAKE_CHECK_OPTS --parallel=1"
61 --enable-all-programs \
64 $MAKE check TS_COMMAND
="true" ||
return
65 sudo
-E $MAKE check TS_OPTS
="$opts" ||
return
66 sudo
$MAKE install ||
return
73 $MAKE distcheck ||
return
76 function travis_install_script
78 # install some packages from Ubuntu's default sources
79 sudo apt-get
-qq update ||
return
80 sudo apt-get
install -qq >/dev
/null \
90 # install/upgrade custom stuff from non-official sources
91 sudo add-apt-repository
-y ppa
:malcscott
/socat ||
return
92 sudo apt-get
-qq update ||
return
93 sudo apt-get
install -qq >/dev
/null \
98 function travis_before_script
100 pushd "$SOURCE_DIR" ||
return
111 function travis_script
116 case "$MAKE_CHECK" in
127 echo "error, check environment (travis.yml)" >&2
132 # We exit here with case-switch return value!
138 function travis_after_script
143 # find diff dir from check as well as from distcheck
144 diff_dir
=$
(find -type d
-a -name "diff" |
grep "tests/diff" |
head -n 1)
145 if [ -d "$diff_dir" ]; then
146 tmp
=$
(find "$diff_dir" -type f |
sort)
147 echo -en "dump test diffs:\n${tmp}\n"
148 echo "$tmp" |
xargs -r cat