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