source: trunk/test/testcompile.sh@ 213

Last change on this file since 213 was 210, checked in by katerina, 16 years ago

Fix for ticket #136 (compile error); also enhance testsuite to catch compiler warnings.

File size: 29.9 KB
RevLine 
[1]1#! /bin/sh
2
[27]3#
4# Copyright Rainer Wichmann (2006)
5#
6# License Information:
7# This program is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation; either version 2 of the License, or
10# (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program; if not, write to the Free Software
19# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20#
21
[210]22# dnmalloc + flawfinder + (36 * 3)
23MAXTEST=110; export MAXTEST
[1]24
[171]25run_dnmalloc ()
26{
27 fail=0
28 if test x$1 = x0; then
29 [ -z "$verbose" ] || log_msg_ok "configure...";
30 $MAKE clean > /dev/null 2>> test_log
31 $MAKE test_dnmalloc > /dev/null 2>> test_log
32 if test x$? = x0; then
33 [ -z "$verbose" ] || log_msg_ok "make test_dnmalloc...";
34 else
35 [ -z "$quiet" ] && log_msg_fail "make test_dnmalloc...";
36 fail=1
37 fi
38 else
39 [ -z "$quiet" ] && log_msg_fail "configure...";
40 if [ x"$3" = xskip ]; then
41 [ -z "$quiet" ] && log_skip $2 ${MAXTEST} "test dnmalloc";
42 fi
43 fail=1
44 fi
45 if [ $fail -eq 1 ]; then
46 [ -z "$quiet" ] && log_fail $2 ${MAXTEST} "test dnmalloc";
47 return 1
48 fi
49 #
50 fail=0
51 ./test_dnmalloc >/dev/null
52 if test x$? = x0; then
53 [ -z "$verbose" ] || log_msg_ok "run 1 completed...";
54 ./test_dnmalloc 300 12 3000 150000 400 >/dev/null
55 if test x$? = x0; then
56 [ -z "$verbose" ] || log_msg_ok "run 2 completed...";
57 ./test_dnmalloc 1 1 4000 10000000 1000 >/dev/null
58 if test x$? = x0; then
59 [ -z "$verbose" ] || log_msg_ok "run 3 completed...";
60 ./test_dnmalloc 1 1 4000 10000000 1000 >/dev/null
61 if test x$? = x0; then
62 [ -z "$verbose" ] || log_msg_ok "run 4 completed...";
63 else
64 fail=1
65 fi
66 else
67 fail=1
68 fi
69 else
70 fail=1
71 fi
72 else
73 fail=1
74 fi
75 #
76 if test x$fail = x0; then
77 [ -z "$quiet" ] && log_ok $2 ${MAXTEST} "test dnmalloc";
78 return 0
79 else
80 [ -z "$quiet" ] && log_fail $2 ${MAXTEST} "test dnmalloc";
81 return 1
82 fi
83}
84
85run_uno ()
86{
87 if [ -z "$doall" ]; then
88 [ -z "$quiet" ] && log_skip $2 ${MAXTEST} "$TEST (uno)";
89 return 0
90 fi
91 #
92 UNO=`find_path uno`
93 #
94 if [ -z "$UNO" ]; then
95 log_skip $num $MAXTEST 'check w/uno (not in PATH)'
96 return 0
97 fi
98 #
99 cd src/
[172]100 stat=`uno -DHAVE_MMAP=1 -DUSE_UNO=1 -t -I. -I.. -I../include sh_*.c samhain.c slib.c dnmalloc.c zAVLTree.c trustfile.c rijndael-*.c bignum.c 2>&1 | wc -l`
[171]101 if [ $stat -ne 1 ]; then
[172]102 uno -DSH_WITH_CLIENT -DSH_WITH_SERVER -DHAVE_MMAP=1 -DUSE_UNO=1 -t -I. -I.. -I../include sh_*.c samhain.c slib.c dnmalloc.c zAVLTree.c trustfile.c rijndael-*.c bignum.c >>../test_log 2>&1
[171]103 retval=1
104 [ -z "$quiet" ] && log_fail $2 ${MAXTEST} "$TEST (uno)";
105 else
106 retval=0
107 [ -z "$quiet" ] && log_ok $2 ${MAXTEST} "$TEST (uno)";
108 fi
109 cd ..
110 return $retval
111}
112
[30]113run_flawfinder ()
114{
115 flawfinder --minlevel=3 --quiet src/s*.c | \
116 egrep '^No hits found.' >/dev/null 2>&1
117 if [ $? -eq 0 ]; then
118 [ -z "$quiet" ] && log_ok $2 ${MAXTEST} "$TEST";
119 else
120 flawfinder --minlevel=3 --quiet src/s*.c >test_log 2>&1
121 [ -z "$quiet" ] && log_fail $2 ${MAXTEST} "$TEST";
122 return 1
123 fi
124}
125
[22]126run_smatch ()
127{
128 export CDIR=`pwd`;
129
130 if [ -z "$doall" ]; then
131 [ -z "$quiet" ] && log_skip $2 ${MAXTEST} "$TEST (smatch)";
132 return 0
133 fi
134
[170]135 if [ ! -f "./x_samhain.c.sm" ]; then
[171]136 [ -z "$quiet" ] && log_skip $2 ${MAXTEST} "$TEST (skip sm)";
[170]137 return 0
138 fi
139
[22]140 if [ "x$3" = "xdebug" ]; then memcheck=debug; else memcheck=simple; fi
[91]141 if [ -f ../../static/sm_scripts/smatch.pm ]; then
[22]142 (
[91]143 cd ../../static/sm_scripts;
[22]144
145 for i in ${CDIR}/*.c.sm ; do
146 # echo $i;
[140]147 cat $i | ./unreached_code.pl | grep -v sh_threaded_module_run;
[22]148 cat $i | ./ampersand_missing.sh;
149 cat $i | ./eqeq.pl;
[96]150 cat $i | ./for_bounds.pl; # doesn't work?
[22]151 cat $i | ./unchecked_returns.pl;
[96]152 cat $i | ./uninitialized.pl; # doesn't work?
153
[22]154 # from http://people.redhat.com/mstefani/wine/smatch/
155 if [ -f ./while_for_check.pl ]; then
[96]156 cat $i | ./while_for_check.pl; # works
[22]157 fi
158 # --> end wine <--
[96]159
160 # samhain specific modifications (list of free/malloc funcs)
161 # doesn't seem to find anything useful
[22]162 if [ $memcheck = xsimple ]; then
163 if [ -f ./samhain_unfree.pl ]; then
164 cat $i | ./samhain_unfree.pl | \
165 egrep -v 'x_cutest_.*Test_' | \
166 egrep -v 'x_sh_unix.c .... .... sh_unix_copyenv';
167 fi
168 fi
169 if [ $memcheck = xdebug ]; then
170 if [ -f ./samhain_unfree_debug.pl ]; then
171 cat $i | ./samhain_unfree_debug.pl | \
172 egrep -v 'x_cutest_.*Test_' | \
173 egrep -v 'x_sh_unix.c .... .... sh_unix_copyenv';
174 fi
175 fi
176 # --> end samhain specific <--
[96]177
178 echo malloc > list_null_funcs_uniq;
179 echo getenv >> list_null_funcs_uniq;
[22]180 cat $i | ./deference_check.pl;
181 rm -f list_null_funcs_uniq;
182 rm -f $i
183 done
184 ) >test_log_smatch 2>&1
185 if [ -f test_log_smatch ]; then
186 lines=`cat test_log_smatch | wc -l`
187 if [ $lines -ne 0 ]; then
188 cat test_log_smatch
189 rm -f test_log_smatch
190 [ -z "$quiet" ] && log_fail $2 ${MAXTEST} "$TEST (smatch)";
191 return 1
192 fi
193 fi
194 [ -z "$quiet" ] && log_ok $2 ${MAXTEST} "$TEST (smatch)";
195 return 0
196 fi
197 [ -z "$quiet" ] && log_skip $2 ${MAXTEST} "$TEST (smatch)";
198 return 0
199}
200
[1]201testmake ()
202{
[19]203 fail=0
[210]204 #
205 # Compiler warnings can be OS specific, but at least
206 # on Linux there should be none
207 #
208 isLinux=0
209 uname -a | grep Linux >/dev/null
210 if [ $? -eq 0 ]; then
211 isLinux=1
212 sed --in-place 's/-Wall/-Wall -Werror/' Makefile
213 fi
214 #
[1]215 if test x$1 = x0; then
[19]216 [ -z "$verbose" ] || log_msg_ok "configure... $TEST";
[138]217 $MAKE clean > /dev/null 2>> test_log
[22]218 $MAKE ${SMATCH} cutest > /dev/null 2>> test_log
[1]219 if test x$? = x0; then
[19]220 [ -z "$verbose" ] || log_msg_ok "make cutest... $TEST";
[1]221 else
[19]222 [ -z "$quiet" ] && log_msg_fail "make cutest... $TEST";
223 fail=1
[1]224 fi
225 else
[19]226 [ -z "$quiet" ] && log_msg_fail "configure... $TEST";
227 if [ x"$3" = xskip ]; then
228 [ -z "$quiet" ] && log_skip $2 ${MAXTEST} "$TEST";
229 fi
230 fail=1
[1]231 fi
[210]232 if [ $isLinux -eq 1 ]; then
233 sed --in-place 's/-Wall -Werror/-Wall/' Makefile
234 fi
[19]235 if [ $fail -eq 1 ]; then
236 [ -z "$quiet" ] && log_fail $2 ${MAXTEST} "$TEST";
237 return 1
238 fi
239 [ -z "$quiet" ] && log_ok $2 ${MAXTEST} "$TEST";
240 return 0
[1]241}
242
243testcompile ()
244{
[19]245 log_start "COMPILE"
[1]246
[171]247 if [ "x$doall" = xon ]; then
[172]248 uname -a | grep x86_64 >/dev/null
249 if [ $? -ne 0 ]; then
250 if [ -f /usr/local/gcc-smatch/bin/gcc ]; then # FIXME
251 SAVE_CC="${CC}"
252 SMATCH="DBGDEF=--smatch"; export SMATCH
253 SAVE_SMATCH="${SMATCH}"; export SAVE_SMATCH
254 CC="/usr/local/gcc-smatch/bin/gcc"; export CC
255 SMATCH_CC="${CC}"
256 fi
[171]257 fi
[22]258 fi
259
[19]260 num=0
261 numfail=0
262
[1]263 #
[171]264 # test dnmalloc
265 #
266 TEST="${S}check dnmalloc${E}"
267 #
268 ${TOP_SRCDIR}/configure --quiet > /dev/null 2>> test_log
269 #
270 let "num = num + 1" >/dev/null
271 #
272 run_dnmalloc 0 $num || let "numfail = numfail + 1" >/dev/null
273 #
274
275 #
[30]276 # test flawfinder
277 #
278 TEST="${S}check w/flawfinder${E}"
279 #
280 #
281 let "num = num + 1" >/dev/null
282 FLAWFINDER=`find_path flawfinder`
283 #
284 if [ -z "$FLAWFINDER" ]; then
285 log_skip $num $MAXTEST 'check w/flawfinder (not in PATH)'
286 else
287 run_flawfinder 0 $num || let "numfail = numfail + 1" >/dev/null
288 fi
289 #
290
291 #
[1]292 # test standalone compilation
293 #
[75]294 TEST="${S}standalone w/suidcheck w/procchk${E}"
[1]295 #
296 if test -r "Makefile"; then
297 $MAKE distclean
298 fi
299 #
[68]300 ${TOP_SRCDIR}/configure --quiet --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test --enable-suidcheck --enable-process-check > /dev/null 2>> test_log
[1]301 #
[19]302 let "num = num + 1" >/dev/null
303 testmake $? $num || let "numfail = numfail + 1" >/dev/null
[22]304 let "num = num + 1" >/dev/null
305 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]306 let "num = num + 1" >/dev/null
307 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[1]308
309 #
310 # test standalone compilation
311 #
[145]312 TEST="${S}standalone static w/suidcheck w/procchk${E}"
313 #
314 if test -r "Makefile"; then
315 $MAKE distclean
316 fi
317 #
[170]318 [ -z "${SMATCH}" ] || { CC="${SAVE_CC}"; export CC; SMATCH=""; export SMATCH; }
319 #
[183]320 ${TOP_SRCDIR}/configure --quiet --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test --enable-static --enable-suidcheck --enable-process-check --enable-logfile-monitor > /dev/null 2>> test_log
[145]321 #
322 let "num = num + 1" >/dev/null
323 testmake $? $num || let "numfail = numfail + 1" >/dev/null
324 let "num = num + 1" >/dev/null
325 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]326 let "num = num + 1" >/dev/null
327 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[145]328 #
[170]329 [ -z "${SMATCH_CC}" ] || { CC="${SMATCH_CC}"; export CC; SMATCH="${SAVE_SMATCH}"; export SMATCH; }
330 #
[145]331 # test standalone compilation
332 #
[75]333 TEST="${S}standalone w/procchk w/portchk${E}"
[68]334 #
335 if test -r "Makefile"; then
336 $MAKE distclean
337 fi
338 #
339 ${TOP_SRCDIR}/configure --quiet --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test --enable-process-check --enable-port-check > /dev/null 2>> test_log
340 #
341 let "num = num + 1" >/dev/null
342 testmake $? $num || let "numfail = numfail + 1" >/dev/null
343 let "num = num + 1" >/dev/null
344 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]345 let "num = num + 1" >/dev/null
346 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[68]347
348 #
349 # test standalone compilation
350 #
[210]351 TEST="${S}standalone w/procchk w/portchk w/static${E}"
352 #
353 if test -r "Makefile"; then
354 $MAKE distclean
355 fi
356 #
357 ${TOP_SRCDIR}/configure --quiet --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test --enable-process-check --enable-port-check --enable-static > /dev/null 2>> test_log
358 #
359 let "num = num + 1" >/dev/null
360 testmake $? $num || let "numfail = numfail + 1" >/dev/null
361 let "num = num + 1" >/dev/null
362 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
363 let "num = num + 1" >/dev/null
364 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
365
366 #
367 # test standalone compilation
368 #
[75]369 TEST="${S}standalone w/procchk w/portchk w/stealth${E}"
370 #
371 if test -r "Makefile"; then
372 $MAKE distclean
373 fi
374 #
375 ${TOP_SRCDIR}/configure --quiet --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test --enable-stealth=164 --enable-process-check --enable-port-check > /dev/null 2>> test_log
376 #
377 let "num = num + 1" >/dev/null
378 testmake $? $num || let "numfail = numfail + 1" >/dev/null
379 let "num = num + 1" >/dev/null
380 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]381 let "num = num + 1" >/dev/null
382 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[75]383
384 #
385 # test standalone compilation
386 #
[22]387 TEST="${S}standalone w/mounts-check w/userfiles${E}"
[1]388 #
389 if test -r "Makefile"; then
390 $MAKE distclean
391 fi
392 #
393 ${TOP_SRCDIR}/configure --quiet --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test --enable-mounts-check --enable-userfiles > /dev/null 2>> test_log
394 #
[19]395 let "num = num + 1" >/dev/null
396 testmake $? $num || let "numfail = numfail + 1" >/dev/null
[22]397 let "num = num + 1" >/dev/null
398 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]399 let "num = num + 1" >/dev/null
400 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[1]401
402
403 #
404 # test standalone compilation
405 #
[22]406 TEST="${S}standalone w/timeserver and w/msgqueue${E}"
[1]407 #
408 if test -r "Makefile"; then
409 $MAKE clean
410 fi
411 #
412 ${TOP_SRCDIR}/configure --quiet --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test --enable-message-queue --with-timeserver=127.0.0.1 > /dev/null 2>> test_log
413 #
[19]414 let "num = num + 1" >/dev/null
415 testmake $? $num || let "numfail = numfail + 1" >/dev/null
[22]416 let "num = num + 1" >/dev/null
417 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]418 let "num = num + 1" >/dev/null
419 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[1]420
421 #
422 # test standalone compilation with --with-nocl=PW
423 #
[183]424 TEST="${S}standalone w/nocl w/logmon${E}"
[1]425 #
426 if test -r "Makefile"; then
427 $MAKE clean
428 fi
429 #
[183]430 ${TOP_SRCDIR}/configure --quiet --prefix=$PW_DIR --enable-nocl="owl" --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test --enable-logfile-monitor > /dev/null 2>> test_log
[1]431 #
[19]432 let "num = num + 1" >/dev/null
433 testmake $? $num || let "numfail = numfail + 1" >/dev/null
[22]434 let "num = num + 1" >/dev/null
435 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]436 let "num = num + 1" >/dev/null
437 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[1]438
439 #
440 # test standalone compilation w/ debug
441 #
[22]442 TEST="${S}standalone w/debug${E}"
[1]443 #
444 if test -r "Makefile"; then
445 $MAKE clean
446 fi
447 #
448 ${TOP_SRCDIR}/configure --quiet --enable-debug --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
449 #
[19]450 let "num = num + 1" >/dev/null
451 testmake $? $num || let "numfail = numfail + 1" >/dev/null
[22]452 let "num = num + 1" >/dev/null
453 run_smatch $? $num debug || let "numfail = numfail + 1" >/dev/null
[171]454 let "num = num + 1" >/dev/null
455 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[1]456
457 #
458 # test standalone compilation w/ gpg
459 #
[22]460 TEST="${S}standalone w/gpg${E}"
[1]461 #
[19]462 GPG=`find_path gpg`
463 let "num = num + 1" >/dev/null
464 #
465 if [ -z "$GPG" ]; then
466 log_skip $num $MAXTEST 'gpg not in PATH'
[29]467 let "num = num + 1" >/dev/null
[54]468 log_skip $num $MAXTEST 'gpg not in PATH'
[19]469 else
470 if test -r "Makefile"; then
[1]471 $MAKE clean
[19]472 fi
473 #
474 ${TOP_SRCDIR}/configure --quiet --with-gpg=$GPG --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
475 #
476 testmake $? $num || let "numfail = numfail + 1" >/dev/null
[22]477 let "num = num + 1" >/dev/null
478 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]479 let "num = num + 1" >/dev/null
480 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[1]481 fi
482
483 #
484 # test standalone compilation w/stealth
485 #
[22]486 TEST="${S}standalone w/stealth${E}"
[1]487 #
488 if test -r "Makefile"; then
489 $MAKE clean
490 fi
491 #
492 ${TOP_SRCDIR}/configure --quiet --enable-stealth=128 --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
493 #
[19]494 let "num = num + 1" >/dev/null
495 testmake $? $num || let "numfail = numfail + 1" >/dev/null
[22]496 let "num = num + 1" >/dev/null
497 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]498 let "num = num + 1" >/dev/null
499 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[1]500
501 #
[183]502 # test standalone compilation w/loginwatch
[1]503 #
[22]504 TEST="${S}standalone w/login-watch${E}"
[1]505 #
506 if test -r "Makefile"; then
507 $MAKE clean
508 fi
509 #
510 ${TOP_SRCDIR}/configure --quiet --enable-login-watch --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
511 #
[19]512 let "num = num + 1" >/dev/null
513 testmake $? $num || let "numfail = numfail + 1" >/dev/null
[22]514 let "num = num + 1" >/dev/null
515 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]516 let "num = num + 1" >/dev/null
517 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[1]518
519 #
[19]520 # test standalone compilation w/mysql
521 #
[22]522 TEST="${S}standalone w/mysql${E}"
[19]523 #
524 if test -r "Makefile"; then
525 $MAKE clean
526 fi
527 #
528 ${TOP_SRCDIR}/configure --quiet --enable-xml-log --with-database=mysql --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
529 #
530 let "num = num + 1" >/dev/null
531 testmake $? $num "skip" || let "numfail = numfail + 1" >/dev/null
[22]532 let "num = num + 1" >/dev/null
533 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]534 let "num = num + 1" >/dev/null
535 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[19]536
537 #
[54]538 # test standalone compilation w/mysql and stealth
539 #
540 TEST="${S}standalone w/mysql+stealth${E}"
541 #
542 if test -r "Makefile"; then
543 $MAKE clean
544 fi
545 #
546 ${TOP_SRCDIR}/configure --quiet --enable-xml-log --enable-stealth=128 --with-database=mysql --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
547 #
548 let "num = num + 1" >/dev/null
549 testmake $? $num "skip" || let "numfail = numfail + 1" >/dev/null
550 let "num = num + 1" >/dev/null
551 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]552 let "num = num + 1" >/dev/null
553 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[54]554
555 #
[19]556 # test standalone compilation w/postgresql
557 #
[22]558 TEST="${S}standalone w/postgresql${E}"
[19]559 #
560 if test -r "Makefile"; then
561 $MAKE clean
562 fi
563 #
564 ${TOP_SRCDIR}/configure --quiet --enable-xml-log --with-database=postgresql --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
565 #
566 let "num = num + 1" >/dev/null
567 testmake $? $num "skip" || let "numfail = numfail + 1" >/dev/null
[22]568 let "num = num + 1" >/dev/null
569 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]570 let "num = num + 1" >/dev/null
571 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[19]572
573 #
[54]574 # test standalone compilation w/postgresql+stealth
575 #
576 TEST="${S}standalone w/postgresql+stealth${E}"
577 #
578 if test -r "Makefile"; then
579 $MAKE clean
580 fi
581 #
582 ${TOP_SRCDIR}/configure --quiet --enable-xml-log --enable-stealth=128 --with-database=postgresql --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
583 #
584 let "num = num + 1" >/dev/null
585 testmake $? $num "skip" || let "numfail = numfail + 1" >/dev/null
586 let "num = num + 1" >/dev/null
587 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]588 let "num = num + 1" >/dev/null
589 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[54]590
591 #
[1]592 # test standalone compilation
593 #
[147]594 TEST="${S}standalone w/o mail w/unix_rnd${E}"
[1]595 #
596 if test -r "Makefile"; then
597 $MAKE clean
598 fi
599 #
[147]600 ${TOP_SRCDIR}/configure --quiet --disable-mail --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test --with-rnd=unix > /dev/null 2>> test_log
[1]601 #
[19]602 let "num = num + 1" >/dev/null
603 testmake $? $num || let "numfail = numfail + 1" >/dev/null
[22]604 let "num = num + 1" >/dev/null
605 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]606 let "num = num + 1" >/dev/null
607 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[1]608
609 #
610 # test standalone compilation
611 #
[22]612 TEST="${S}standalone w/o external${E}"
[1]613 #
614 if test -r "Makefile"; then
615 $MAKE clean
616 fi
617 #
618 ${TOP_SRCDIR}/configure --quiet --disable-external-scripts --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
619 #
[19]620 let "num = num + 1" >/dev/null
621 testmake $? $num || let "numfail = numfail + 1" >/dev/null
[22]622 let "num = num + 1" >/dev/null
623 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]624 let "num = num + 1" >/dev/null
625 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[1]626
627 # echo; echo "${S}__ TEST CLIENT/SERVER __${E}"; echo;
628
629 #
630 # test client/server compilation
631 #
632 TEST="${S}client/server application w/timeserver${E}"
633 #
634 if test -r "Makefile"; then
635 $MAKE clean
636 fi
637 #
638 ${TOP_SRCDIR}/configure --quiet --enable-network=client --enable-srp --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test --with-timeserver=127.0.0.1 > /dev/null 2>> test_log
639 #
[19]640 let "num = num + 1" >/dev/null
641 testmake $? $num || let "numfail = numfail + 1" >/dev/null
[22]642 let "num = num + 1" >/dev/null
643 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]644 let "num = num + 1" >/dev/null
645 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[19]646
[1]647 if test -r "Makefile"; then
648 $MAKE clean
649 fi
650 #
651 ${TOP_SRCDIR}/configure --quiet --enable-network=server --enable-srp --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test --with-timeserver=127.0.0.1 > /dev/null 2>> test_log
652 #
[19]653 let "num = num + 1" >/dev/null
654 testmake $? $num || let "numfail = numfail + 1" >/dev/null
[22]655 let "num = num + 1" >/dev/null
656 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]657 let "num = num + 1" >/dev/null
658 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[1]659
660 #
[145]661 # test client/server compilation
662 #
663 TEST="${S}client/server application static w/timeserver${E}"
664 #
665 if test -r "Makefile"; then
666 $MAKE clean
667 fi
668 #
[170]669 [ -z "${SMATCH}" ] || { CC="${SAVE_CC}"; export CC; SMATCH=""; export SMATCH; }
670 #
[183]671 ${TOP_SRCDIR}/configure --quiet --enable-network=client --enable-static --enable-srp --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test --with-timeserver=127.0.0.1 --enable-logfile-monitor > /dev/null 2>> test_log
[145]672 #
673 let "num = num + 1" >/dev/null
674 testmake $? $num || let "numfail = numfail + 1" >/dev/null
675 let "num = num + 1" >/dev/null
676 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]677 let "num = num + 1" >/dev/null
678 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[145]679
680 if test -r "Makefile"; then
681 $MAKE clean
682 fi
683 #
684 ${TOP_SRCDIR}/configure --quiet --enable-network=server --enable-static --enable-srp --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test --with-timeserver=127.0.0.1 > /dev/null 2>> test_log
685 #
686 let "num = num + 1" >/dev/null
687 testmake $? $num || let "numfail = numfail + 1" >/dev/null
688 let "num = num + 1" >/dev/null
689 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]690 let "num = num + 1" >/dev/null
691 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[145]692 #
[170]693 [ -z "${SMATCH_CC}" ] || { CC="${SMATCH_CC}"; export CC; SMATCH="${SAVE_SMATCH}"; export SMATCH; }
694 #
[1]695 # test c/s compilation w/ gpg
696 #
697 TEST="${S}client/server application w/gpg${E}"
698 #
[19]699 GPG=`find_path gpg`
700 let "num = num + 1" >/dev/null
[1]701 #
[19]702 if [ -z "$GPG" ]; then
703 log_skip $num $MAXTEST 'gpg not in PATH'
[54]704 let "num = num + 1" >/dev/null
705 log_skip $num $MAXTEST 'gpg not in PATH'
706 let "num = num + 1" >/dev/null
707 log_skip $num $MAXTEST 'gpg not in PATH'
708 let "num = num + 1" >/dev/null
709 log_skip $num $MAXTEST 'gpg not in PATH'
[19]710 else
711 if test -r "Makefile"; then
[1]712 $MAKE clean
[19]713 fi
714 #
715 ${TOP_SRCDIR}/configure --quiet --enable-network=server --enable-srp --with-gpg=$GPG --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
716 #
717 testmake $? $num || let "numfail = numfail + 1" >/dev/null
[22]718 let "num = num + 1" >/dev/null
719 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]720 let "num = num + 1" >/dev/null
721 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[19]722 #
723 if test -r "Makefile"; then
724 $MAKE clean
725 fi
726 #
[183]727 ${TOP_SRCDIR}/configure --quiet --enable-network=client --enable-srp --with-gpg=$GPG --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test --enable-logfile-monitor > /dev/null 2>> test_log
[19]728 #
729 let "num = num + 1" >/dev/null
730 testmake $? $num || let "numfail = numfail + 1" >/dev/null
[22]731 let "num = num + 1" >/dev/null
732 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]733 let "num = num + 1" >/dev/null
734 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[1]735 fi
736
737
738 #
739 # test client/server compilation
740 #
741 TEST="${S}client/server application w/o srp${E}"
742 #
743 if test -r "Makefile"; then
744 $MAKE clean
745 fi
746 #
747 ${TOP_SRCDIR}/configure --quiet --enable-network=server --disable-srp --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
748 #
[19]749 let "num = num + 1" >/dev/null
750 testmake $? $num || let "numfail = numfail + 1" >/dev/null
[22]751 let "num = num + 1" >/dev/null
752 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]753 let "num = num + 1" >/dev/null
754 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[1]755 #
756 if test -r "Makefile"; then
757 $MAKE clean
758 fi
759 #
760 ${TOP_SRCDIR}/configure --quiet --enable-network=client --disable-srp --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
761 #
[19]762 let "num = num + 1" >/dev/null
763 testmake $? $num || let "numfail = numfail + 1" >/dev/null
[22]764 let "num = num + 1" >/dev/null
765 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]766 let "num = num + 1" >/dev/null
767 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[1]768
769 #
770 # test client/server compilation w/ debug
771 #
772 TEST="${S}client/server application w/debug${E}"
773 #
774 if test -r "Makefile"; then
775 $MAKE clean
776 fi
777 #
778 ${TOP_SRCDIR}/configure --quiet --enable-network=server --enable-debug --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
779 #
[19]780 let "num = num + 1" >/dev/null
781 testmake $? $num || let "numfail = numfail + 1" >/dev/null
[22]782 let "num = num + 1" >/dev/null
783 run_smatch $? $num debug || let "numfail = numfail + 1" >/dev/null
[171]784 let "num = num + 1" >/dev/null
785 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[1]786 #
787 if test -r "Makefile"; then
788 $MAKE clean
789 fi
790 #
[183]791 ${TOP_SRCDIR}/configure --quiet --enable-network=client --enable-debug --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test --enable-logfile-monitor > /dev/null 2>> test_log
[1]792 #
[19]793 let "num = num + 1" >/dev/null
794 testmake $? $num || let "numfail = numfail + 1" >/dev/null
[22]795 let "num = num + 1" >/dev/null
796 run_smatch $? $num debug || let "numfail = numfail + 1" >/dev/null
[171]797 let "num = num + 1" >/dev/null
798 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[1]799
800 #
801 # test client/server compilation w/stealth
802 #
803 TEST="${S}client/server application w/stealth${E}"
804 #
805 if test -r "Makefile"; then
806 $MAKE clean
807 fi
808 #
809 ${TOP_SRCDIR}/configure --quiet --enable-network=server --enable-srp --enable-stealth=128 --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
810 #
[19]811 let "num = num + 1" >/dev/null
812 testmake $? $num || let "numfail = numfail + 1" >/dev/null
[22]813 let "num = num + 1" >/dev/null
814 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]815 let "num = num + 1" >/dev/null
816 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[1]817 #
818 if test -r "Makefile"; then
819 $MAKE clean
820 fi
821 #
822 ${TOP_SRCDIR}/configure --quiet --enable-network=client --enable-srp --enable-stealth=128 --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
823 #
[19]824 let "num = num + 1" >/dev/null
825 testmake $? $num || let "numfail = numfail + 1" >/dev/null
[22]826 let "num = num + 1" >/dev/null
827 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]828 let "num = num + 1" >/dev/null
829 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[1]830
831 #
832 # test client/server compilation w/logwatch
833 #
834 TEST="${S}client/server application w/login-watch${E}"
835 #
836 if test -r "Makefile"; then
837 $MAKE clean
838 fi
839 #
840 ${TOP_SRCDIR}/configure --quiet --enable-network=server --enable-srp --enable-login-watch --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
841 #
[19]842 let "num = num + 1" >/dev/null
843 testmake $? $num || let "numfail = numfail + 1" >/dev/null
[22]844 let "num = num + 1" >/dev/null
845 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]846 let "num = num + 1" >/dev/null
847 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[1]848 #
849 if test -r "Makefile"; then
850 $MAKE clean
851 fi
852 #
853 ${TOP_SRCDIR}/configure --quiet --enable-network=client --enable-srp --enable-login-watch --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
854 #
[19]855 let "num = num + 1" >/dev/null
856 testmake $? $num || let "numfail = numfail + 1" >/dev/null
[22]857 let "num = num + 1" >/dev/null
858 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]859 let "num = num + 1" >/dev/null
860 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[1]861
862 #
863 # test client/server compilation
864 #
865 TEST="${S}client/server application w/o mail${E}"
866 #
867 if test -r "Makefile"; then
868 $MAKE clean
869 fi
870 #
871 ${TOP_SRCDIR}/configure --quiet --enable-network=server --disable-mail --enable-srp --enable-stealth=128 --enable-debug --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
872 #
[19]873 let "num = num + 1" >/dev/null
874 testmake $? $num || let "numfail = numfail + 1" >/dev/null
[22]875 let "num = num + 1" >/dev/null
876 run_smatch $? $num debug || let "numfail = numfail + 1" >/dev/null
[171]877 let "num = num + 1" >/dev/null
878 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[1]879 #
880 if test -r "Makefile"; then
881 $MAKE clean
882 fi
883 #
884 ${TOP_SRCDIR}/configure --quiet --enable-network=client --disable-mail --enable-srp --enable-stealth=128 --enable-debug --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
885 #
[19]886 let "num = num + 1" >/dev/null
887 testmake $? $num || let "numfail = numfail + 1" >/dev/null
[22]888 let "num = num + 1" >/dev/null
889 run_smatch $? $num debug || let "numfail = numfail + 1" >/dev/null
[171]890 let "num = num + 1" >/dev/null
891 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[1]892
893 #
894 # test client/server compilation
895 #
[22]896 TEST="${S}client/server application w/o external${E}"
[1]897 #
898 if test -r "Makefile"; then
899 $MAKE clean
900 fi
901 #
902 ${TOP_SRCDIR}/configure --quiet --enable-network=server --disable-srp --disable-external-scripts --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
903 #
[19]904 let "num = num + 1" >/dev/null
905 testmake $? $num || let "numfail = numfail + 1" >/dev/null
[22]906 let "num = num + 1" >/dev/null
907 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]908 let "num = num + 1" >/dev/null
909 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[1]910 #
911 if test -r "Makefile"; then
912 $MAKE clean
913 fi
914 #
915 ${TOP_SRCDIR}/configure --quiet --enable-network=client --disable-srp --disable-external-scripts --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
916 #
[19]917 let "num = num + 1" >/dev/null
918 testmake $? $num || let "numfail = numfail + 1" >/dev/null
[22]919 let "num = num + 1" >/dev/null
920 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]921 let "num = num + 1" >/dev/null
922 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[19]923
[22]924 [ -z "${SMATCH}" ] || { CC="${SAVE_CC}"; export CC; }
925
[19]926 log_end "COMPILE"
[1]927}
Note: See TracBrowser for help on using the repository browser.