]> mj.ucw.cz Git - libucw.git/commitdiff
Added a script for testing compilability of different feature sets.
authorMartin Mares <mj@ucw.cz>
Sun, 27 Jun 2004 15:37:43 +0000 (15:37 +0000)
committerMartin Mares <mj@ucw.cz>
Sun, 27 Jun 2004 15:37:43 +0000 (15:37 +0000)
build/check-customs [new file with mode: 0755]

diff --git a/build/check-customs b/build/check-customs
new file mode 100755 (executable)
index 0000000..0d5ed23
--- /dev/null
@@ -0,0 +1,58 @@
+#!/bin/bash
+# A script for testing compilability of different configurations
+# (c) 2004 Martin Mares <mj@ucw.cz>
+
+set -e
+
+TEST=0
+
+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"
+               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 [ -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_GATHERD !CONFIG_GATHERER !CONFIG_REAPD !CONFIG_INDEXER     # search servers
+try centrum !CONFIG_GATHERD !CONFIG_GATHERER !CONFIG_REAPD                     # indexing server
+try centrum !CONFIG_GATHERD                                                    # gathering server
+
+rm -rf custom
+if [ -e custom.old ] ; then
+       mv custom.old custom
+fi