2014-12-05 10:04:50 -05:00
|
|
|
#!/bin/sh
|
2014-12-21 08:14:19 -05:00
|
|
|
#
|
2014-12-05 10:04:50 -05:00
|
|
|
# Do some checking before 'git push'.
|
|
|
|
|
2015-06-14 16:05:53 -04:00
|
|
|
# Set a stricter bash mode
|
|
|
|
set -e
|
|
|
|
set -u
|
2014-12-05 10:04:50 -05:00
|
|
|
|
2015-06-14 16:05:53 -04:00
|
|
|
CORES=$(grep -c ^processor /proc/cpuinfo 2> /dev/null || echo 0)
|
|
|
|
if [ $CORES -lt 1 ]; then CORES=1; fi
|
2014-12-05 10:04:50 -05:00
|
|
|
|
2015-06-14 16:05:53 -04:00
|
|
|
echo "Running: make distclean"
|
|
|
|
make distclean > /dev/null || true
|
2014-12-05 10:04:50 -05:00
|
|
|
|
2015-06-14 14:30:07 -04:00
|
|
|
CFLAGS="-std=c89 -pedantic -O2 -g -Wall -Wextra -Wstrict-prototypes -Wold-style-definition -Wwrite-strings -Wshadow -Wformat -Wformat-security -Wunreachable-code -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition"
|
2014-12-05 10:04:50 -05:00
|
|
|
|
|
|
|
CACHEFILE=$PWD/config_check.cache
|
|
|
|
|
2014-12-21 08:14:19 -05:00
|
|
|
# measure time consumed and print it at the end of the script
|
2014-12-05 10:04:50 -05:00
|
|
|
START=$(date +%s.%N)
|
|
|
|
|
2015-06-14 16:05:53 -04:00
|
|
|
echo "Running: ./bootstrap"
|
|
|
|
./bootstrap > /dev/null
|
2014-12-05 10:04:50 -05:00
|
|
|
echo
|
|
|
|
|
|
|
|
for CC in gcc clang; do
|
|
|
|
export CC
|
2015-06-14 16:05:53 -04:00
|
|
|
echo "*** Testing with CC=$CC"
|
2014-12-05 10:04:50 -05:00
|
|
|
|
|
|
|
# the compiler changed, so we have to remove the cache file here
|
|
|
|
rm -f $CACHEFILE
|
|
|
|
|
|
|
|
for options in "" "--with-ssl=openssl"; do
|
|
|
|
export DISTCHECK_CONFIGURE_FLAGS="-C --cache-file=$CACHEFILE $options"
|
|
|
|
echo " ./configure $DISTCHECK_CONFIGURE_FLAGS"
|
2015-06-14 16:05:53 -04:00
|
|
|
./configure $DISTCHECK_CONFIGURE_FLAGS CFLAGS="$CFLAGS" > /dev/null
|
2014-12-05 10:04:50 -05:00
|
|
|
|
|
|
|
for xVALGRIND in 0 1; do
|
|
|
|
for xLCALL in C tr_TR.utf8; do
|
|
|
|
export TESTS_ENVIRONMENT="LC_ALL=$xLCALL VALGRIND_TESTS=$xVALGRIND"
|
|
|
|
echo " TESTS_ENVIRONMENT=\"$TESTS_ENVIRONMENT\"" make check -j$CORES
|
2015-06-14 16:05:53 -04:00
|
|
|
make check -j$CORES > /dev/null
|
2014-12-05 10:04:50 -05:00
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
unset TESTS_ENVIRONMENT
|
|
|
|
export TESTS_ENVIRONMENT
|
2015-06-14 16:05:53 -04:00
|
|
|
echo " make distcheck CFLAGS=$CFLAGS -j$CORES"
|
|
|
|
make distcheck CFLAGS="$CFLAGS" -j$CORES > /dev/null
|
2014-12-05 10:04:50 -05:00
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
END=$(date +%s.%N)
|
|
|
|
echo "Duration: "$(echo "$END - $START" | bc)
|