From 1e2910f13f1995570fd9b5f5ed7af6d2c448ab79 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Fri, 30 Jul 2010 20:53:53 +0200 Subject: [PATCH] Added a script for checking different configurations of LibUCW Adapted from Sherlock's check-customs. --- debug/check-configs | 61 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100755 debug/check-configs diff --git a/debug/check-configs b/debug/check-configs new file mode 100755 index 00000000..2746fd1e --- /dev/null +++ b/debug/check-configs @@ -0,0 +1,61 @@ +#!/bin/bash +# A script for testing compilability of different configurations +# (c) 2004--2010 Martin Mares + +set -e + +TEST=0 +ERR= +CC=${CC:-gcc} +MAKEOPTS=${MAKEOPTS:--j8} + +function die +{ + echo >&3 " $@" + exit 1 +} + +function try +{ + TEST=$(($TEST+1)) + TDIR=tests/$TEST + mkdir $TDIR + echo "### Test $TEST: $@ ###" | tee $TDIR/log + CONFIG="$1" + shift + ARGS="$@ CC=$CC" + + ( + cd $TDIR + exec 3>&2 >>log 2>&1 + case $CONFIG in + *) ../../configure $CONFIG $ARGS || die "CANNOT CONFIGURE" + ;; + esac + make $MAKEOPTS || die FAILED + echo >&3 " COMPILATION PASSED" + if [ -z "$SKIP_TESTS" ] ; then + make -k tests || die "TESTS FAILED" + echo >&3 " TESTS PASSED" + fi + ) || ERR=1 +} + +rm -rf tests +mkdir tests +if [ "$1" == DARWIN ] ; then + # All tests on Darwin need CONFIG_SHARED, due to libcharset collision + # only visible with static linking. + FLAGS="CONFIG_SHARED" + try debug/default.cfg $FLAGS CONFIG_PCRE # `make tests' does not work with non-local builds with shared libs +elif [ -n "$1" ] ; then + try "$@" +else + try default.cfg CONFIG_LOCAL + try debug/default.cfg # debugging configuration + try debug/default.cfg -CONFIG_THREADS # non-threaded configuration + try debug/default.cfg -CONFIG_UCW_TLS # threaded, but no TLS support in gcc + try debug/default.cfg -CONFIG_EPOLL # without epoll +fi + +[ -z "$ERR" ] -- 2.39.2