#!/bin/bash
# A script for testing compilability of different configurations
-# (c) 2004 Martin Mares <mj@ucw.cz>
+# (c) 2004--2006 Martin Mares <mj@ucw.cz>
set -e
function try
{
TEST=$(($TEST+1))
- echo "### Test $TEST: $@ ###"
-
- CUST=$1
- shift
- SUBST=
- APP="!!### Added by check-customs:"
- while [ -n "$1" ] ; do
- X=$1
- Y=${X#!}
- if [ "$X" != "$Y" ] ; then
- SUBST="${S}/^$Y/s/^/# /;"
- else
- APP="$APP!$X"
+ TDIR=tests/$TEST
+ mkdir $TDIR
+ echo "### Test $TEST: $@ ###" | tee $TDIR/log
+
+ (
+ cd $TDIR
+ if ! ../../configure $@ CC=gcc-3.4 >>log 2>&1 ; then
+ echo " CANNOT CONFIGURE"
+ exit 1
fi
- shift
- done
- rm -rf custom
- mkdir custom custom/lib
- cp $CUST/lib/custom.h custom/lib/
- cp $CUST/Makefile custom/
- sed "$SUBST;p;d" <$CUST/config.mk >custom/config.mk
- echo $APP | tr ! '\n' >>custom/config.mk
-
- make clean >test$TEST.log 2>&1
- if ! make >>test$TEST.log 2>&1 ; then
- echo " FAILED"
- exit 1
- fi
- echo " PASSED"
+ if ! make >>log 2>&1 ; then
+ echo " FAILED"
+ exit 1
+ fi
+ echo " PASSED"
+ )
}
-if [ -e custom -a ! -e custom.old ] ; then
- mv custom custom.old
-fi
-
-rm -f test*.log
-try free # the free version
-try bare !CONFIG_INDEXER !CONFIG_SEARCH # absolutely stripped version
-try bare # the bare version
-try centrum !CONFIG_GATHERER !CONFIG_GATHERD !CONFIG_SHEPHERD !CONFIG_REAPD !CONFIG_INDEXER # search servers
-try centrum !CONFIG_GATHERER !CONFIG_GATHERD !CONFIG_SHEPHERD !CONFIG_REAPD # indexing server
-try centrum !CONFIG_GATHERD !CONFIG_SHEPHERD !CONFIG_INDEXER !CONFIG_SEARCH # reapd server
-try centrum # full config
-
-rm -rf custom
-if [ -e custom.old ] ; then
- mv custom.old custom
+rm -rf tests
+mkdir tests
+if [ -n "$1" ] ; then
+ try "$@"
+else
+ try free # the free version
+ try bare -CONFIG_INDEXER -CONFIG_SEARCH # absolutely stripped version
+ try bare # the bare version
+ try debug/matcher-test # bare + custom stats and matchers
+ try centrum/cz ROLE=search1-x # various Centrum.cz configurations
+ try centrum/cz ROLE=indexer
+ try centrum/cz ROLE=gather
+ try centrum/cz ROLE=reap+watson
+ try centrum/cz ROLE=all CONFIG_PARTMAP_IS_MMAP
+ try centrum/pl ROLE=all
+ try debug CONFIG_SHARED # debugging configuration with shared libs
+ try debug # debugging configuration
fi