2015-08-06 13:23:38 +02:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Do some checking before 'git push'.
|
|
|
|
|
|
|
|
# Set a stricter bash mode
|
|
|
|
set -e
|
|
|
|
set -u
|
|
|
|
|
2017-07-20 14:46:55 +02:00
|
|
|
CORES=$(nproc)
|
2015-08-06 13:23:38 +02:00
|
|
|
|
|
|
|
echo "Running: make distclean"
|
|
|
|
make distclean > /dev/null || true
|
|
|
|
|
|
|
|
# We define _GNU_SOURCE to avoid warnings with missing prototypes.
|
|
|
|
# C89 does not know snprintf, strdup, strndup, popen, pclose
|
2017-07-20 14:46:55 +02:00
|
|
|
CFLAGS="-std=gnu89 -pedantic -g -Wall -Wextra -Wstrict-prototypes -Wold-style-definition -Wwrite-strings -Wshadow -Wformat -Wformat-security -Wunreachable-code -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition"
|
2015-08-06 13:23:38 +02:00
|
|
|
|
|
|
|
CACHEFILE=$PWD/config_check.cache
|
|
|
|
|
|
|
|
# measure time consumed and print it at the end of the script
|
|
|
|
START=$(date +%s.%N)
|
|
|
|
|
|
|
|
# avoid annoying ar warning
|
|
|
|
export ARFLAGS="cr"
|
|
|
|
export AR_FLAGS="cr"
|
|
|
|
|
|
|
|
echo "Running: ./autogen.sh"
|
|
|
|
./autogen.sh > /dev/null
|
|
|
|
echo
|
|
|
|
|
|
|
|
for CC in gcc clang; do
|
|
|
|
export CC
|
|
|
|
echo
|
|
|
|
echo "*** Testing with CC=$CC"
|
|
|
|
|
|
|
|
# the compiler changed, so we have to remove the cache file here
|
|
|
|
rm -f $CACHEFILE
|
|
|
|
|
|
|
|
for options in \
|
|
|
|
"--enable-runtime=libicu --enable-builtin=libicu" \
|
|
|
|
"--enable-runtime=libidn2 --enable-builtin=libidn2" \
|
2015-12-26 14:15:08 +01:00
|
|
|
"--enable-runtime=libidn --enable-builtin=libidn" \
|
|
|
|
"--disable-runtime --enable-builtin=libicu"; do
|
2017-07-20 14:46:55 +02:00
|
|
|
export DISTCHECK_CONFIGURE_FLAGS="-q -C --cache-file=$CACHEFILE $options"
|
2017-06-20 16:44:41 +02:00
|
|
|
if test "$CC" = "clang"; then
|
2017-07-20 14:46:55 +02:00
|
|
|
echo
|
|
|
|
echo " *** CC=$CC ./configure $DISTCHECK_CONFIGURE_FLAGS --enable-cfi"
|
|
|
|
./configure $DISTCHECK_CONFIGURE_FLAGS --enable-cfi CFLAGS="$CFLAGS"
|
|
|
|
for xLCALL in C tr_TR.utf8; do
|
|
|
|
make -s clean
|
|
|
|
make -s check -j$CORES
|
|
|
|
done
|
2017-06-16 16:51:33 +02:00
|
|
|
fi
|
2015-08-06 13:23:38 +02:00
|
|
|
|
2017-07-20 14:46:55 +02:00
|
|
|
for flags in --enable-ubsan --enable-asan; do
|
|
|
|
# case "$flags" in *-asan) case $options in *libicu*) continue;; esac;; esac
|
|
|
|
echo
|
|
|
|
echo " *** CC=$CC ./configure $DISTCHECK_CONFIGURE_FLAGS $flags"
|
|
|
|
./configure $DISTCHECK_CONFIGURE_FLAGS $flags CFLAGS="$CFLAGS"
|
|
|
|
for xLCALL in C tr_TR.utf8; do
|
|
|
|
make -s clean
|
|
|
|
make -s check -j$CORES
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
echo
|
|
|
|
echo " *** CC=$CC ./configure $DISTCHECK_CONFIGURE_FLAGS"
|
|
|
|
./configure $DISTCHECK_CONFIGURE_FLAGS CFLAGS="$CFLAGS"
|
2015-08-06 13:23:38 +02: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
|
2017-06-20 16:44:41 +02:00
|
|
|
make -s clean
|
|
|
|
make -s check -j$CORES
|
2015-08-06 13:23:38 +02:00
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
unset TESTS_ENVIRONMENT
|
|
|
|
export TESTS_ENVIRONMENT
|
|
|
|
echo
|
2017-07-20 14:46:55 +02:00
|
|
|
echo " *** $CC: make distcheck CFLAGS=$CFLAGS -j$CORES"
|
|
|
|
./configure $DISTCHECK_CONFIGURE_FLAGS CFLAGS="$CFLAGS"
|
|
|
|
make -s clean
|
|
|
|
make -s check -j$CORES
|
2017-06-20 16:44:41 +02:00
|
|
|
make -s distcheck CFLAGS="$CFLAGS" -j$CORES
|
2015-08-06 13:23:38 +02:00
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
END=$(date +%s.%N)
|
|
|
|
echo
|
|
|
|
echo "Duration: "$(echo "$END - $START" | bc)
|