2015-12-03 12:42:53 -05:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Set a stricter bash mode
|
|
|
|
set -e
|
|
|
|
set -u
|
|
|
|
|
2015-12-10 16:43:31 -05:00
|
|
|
# Set up the subset of tests this Matrix instance will run.
|
|
|
|
|
|
|
|
# One instance is forked for each of the SSL library possibilities
|
2015-12-03 12:42:53 -05:00
|
|
|
SSL=${1:-""}
|
|
|
|
case $SSL in
|
|
|
|
"") SSL_LIB="--without-ssl";;
|
|
|
|
"openssl") SSL_LIB="--with-ssl=openssl";;
|
|
|
|
"gnutls") SSL_LIB="--with-ssl=gnutls";;
|
|
|
|
esac
|
|
|
|
|
|
|
|
# For some reason. /proc/cpuinfo reports 16 cores on Travis, while the docs
|
|
|
|
# claim that each instance has only 2 cores. We believe the docs and force a
|
2015-12-10 16:43:31 -05:00
|
|
|
# value of n+1 here.
|
2015-12-08 08:45:01 -05:00
|
|
|
CORES=3
|
2015-12-03 12:42:53 -05:00
|
|
|
|
|
|
|
# Define a large number of Warning flags for the compiler. Hopefully, someone
|
|
|
|
# will sit and analyze the output to clean the warnings from the codebase.
|
|
|
|
CFLAGS="-std=c89 -pedantic -O2 -Wall -Wextra -Wstrict-prototypes -Wold-style-definition -Wwrite-strings -Wshadow -Wformat -Wformat-security -Wunreachable-code -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition"
|
|
|
|
|
2015-12-10 16:43:31 -05:00
|
|
|
# A cachefile for ./configure. Saves significant time when reconfiguring
|
2015-12-03 12:42:53 -05:00
|
|
|
CACHEFILE=$PWD/config_check.cache
|
|
|
|
|
|
|
|
# measure time consumed and print it at the end of the script
|
|
|
|
START=$(date +%s)
|
|
|
|
|
2015-12-10 16:43:31 -05:00
|
|
|
# Test different Permutations of Wget. Always under Valgrind
|
|
|
|
#
|
|
|
|
# Options:
|
|
|
|
# - All Features Enabled
|
|
|
|
# - C [Default Locale]
|
|
|
|
# - Russian [Multibyte / Multicolumn Locale]
|
|
|
|
# - Turkish [Special Test due to issues with language]
|
|
|
|
# - IPv6 Disabled
|
|
|
|
# - C
|
2015-12-03 12:42:53 -05:00
|
|
|
for options in "" "--disable-ipv6"; do
|
|
|
|
export DISTCHECK_CONFIGURE_FLAGS="-C --cache-file=$CACHEFILE --enable-assert --enable-valgrind-tests $SSL_LIB $options"
|
|
|
|
echo " ./configure $DISTCHECK_CONFIGURE_FLAGS CFLAGS=\"$CFLAGS\""
|
|
|
|
./configure $DISTCHECK_CONFIGURE_FLAGS CFLAGS="$CFLAGS"
|
|
|
|
|
2015-12-10 16:43:31 -05:00
|
|
|
if [[ -z $options ]]; then
|
|
|
|
LANG_ARR=("ru_RU.UTF-8" "tr_TR.UTF-8" "C")
|
|
|
|
else
|
|
|
|
LANG_ARR=("C")
|
|
|
|
fi
|
|
|
|
|
|
|
|
for xLCALL in "${LANG_ARR[@]}"; do
|
2015-12-03 12:42:53 -05:00
|
|
|
export TESTS_ENVIRONMENT="LC_ALL=$xLCALL VALGRIND_TESTS=1"
|
|
|
|
echo " TESTS_ENVIRONMENT=\"$TESTS_ENVIRONMENT\" make distcheck CFLAGS=$CFLAGS -j$CORES"
|
|
|
|
make distcheck CFLAGS="$CFLAGS" -j$CORES
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
END=$(date +%s)
|
|
|
|
echo "Duration: $((END-START))"
|