]> mj.ucw.cz Git - libucw.git/blob - build/check-customs
If previous check-customs run failed, run/cf could be empty.
[libucw.git] / build / check-customs
1 #!/bin/bash
2 # A script for testing compilability of different configurations
3 # (c) 2004--2005 Martin Mares <mj@ucw.cz>
4
5 set -e
6
7 TEST=0
8
9 function try
10 {
11         TEST=$(($TEST+1))
12         LOG=test$TEST.log
13         echo "### Test $TEST: $@ ###" | tee $LOG
14
15         CUST=$1
16         shift
17         SUBST=
18         APP="!!### Added by check-customs:"
19         while [ -n "$1" ] ; do
20                 X=$1
21                 Y=${X#!}
22                 if [ "$X" != "$Y" ] ; then
23                         SUBST="${S}/^$Y/s/^/# /;"
24                 else
25                         APP="$APP!$X"
26                 fi
27                 shift
28         done
29         rm -rf custom
30         cp -a $CUST custom
31         sed "$SUBST;p;d" <$CUST/config.mk >custom/config.mk
32         echo $APP | tr ! '\n' >>custom/config.mk
33
34         make clean >>$LOG 2>&1
35         rm -f run/cf/*
36         if ! make >>$LOG 2>&1 ; then
37                 echo "  FAILED"
38                 exit 1
39         fi
40         echo "  PASSED"
41 }
42
43 if [ -e custom -a ! -e custom.old ] ; then
44         mv custom custom.old
45 fi
46
47 rm -f test*.log
48 if [ -n "$1" ] ; then
49         try "$@"
50 else
51         try free                                                                        # the free version
52         try bare !CONFIG_INDEXER !CONFIG_SEARCH                                         # absolutely stripped version
53         try bare                                                                        # the bare version
54         try debug/matcher-test                                                          # bare + custom stats and matchers
55         try centrum !CONFIG_GATHERER !CONFIG_GATHERD !CONFIG_SHEPHERD !CONFIG_REAPD !CONFIG_INDEXER !CONFIG_MUX !CONFIG_WATSON  # search servers
56         try centrum !CONFIG_GATHERER !CONFIG_GATHERD !CONFIG_SHEPHERD !CONFIG_REAPD !CONFIG_MUX !CONFIG_WATSON  # indexing server
57         try centrum !CONFIG_GATHERD !CONFIG_SHEPHERD !CONFIG_INDEXER !CONFIG_SEARCH !CONFIG_MUX !CONFIG_WATSON  # reapd server
58         try centrum                                                                     # full Centrum config
59         try debug/custom CONFIG_SHARED=1                                                # debugging configuration with shared libs
60         try debug/custom                                                                # debugging configuration
61 fi
62
63 rm -rf custom
64 if [ -e custom.old ] ; then
65         mv custom.old custom
66 fi