source: trunk/test/testcompile.sh@ 357

Last change on this file since 357 was 344, checked in by katerina, 14 years ago

Fix test script for prelude.

File size: 32.5 KB
Line 
1#! /bin/sh
2
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
22# dnmalloc + flawfinder + (36 * 3)
23MAXTEST=116; export MAXTEST
24
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/
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`
101 if [ $stat -ne 1 ]; then
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
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
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
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
135 if [ ! -f "./x_samhain.c.sm" ]; then
136 [ -z "$quiet" ] && log_skip $2 ${MAXTEST} "$TEST (skip sm)";
137 return 0
138 fi
139
140 if [ "x$3" = "xdebug" ]; then memcheck=debug; else memcheck=simple; fi
141 if [ -f ../../static/sm_scripts/smatch.pm ]; then
142 (
143 cd ../../static/sm_scripts;
144
145 for i in ${CDIR}/*.c.sm ; do
146 # echo $i;
147 cat $i | ./unreached_code.pl | grep -v sh_threaded_module_run;
148 cat $i | ./ampersand_missing.sh;
149 cat $i | ./eqeq.pl;
150 cat $i | ./for_bounds.pl; # doesn't work?
151 cat $i | ./unchecked_returns.pl;
152 cat $i | ./uninitialized.pl; # doesn't work?
153
154 # from http://people.redhat.com/mstefani/wine/smatch/
155 if [ -f ./while_for_check.pl ]; then
156 cat $i | ./while_for_check.pl; # works
157 fi
158 # --> end wine <--
159
160 # samhain specific modifications (list of free/malloc funcs)
161 # doesn't seem to find anything useful
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 <--
177
178 echo malloc > list_null_funcs_uniq;
179 echo getenv >> list_null_funcs_uniq;
180 cat $i | ./deference_check.pl |\
181 egrep -v 'x_trustfile.c ... ... sl_trustfile' | \
182 egrep -v 'x_sh_mem.c ';
183 rm -f list_null_funcs_uniq;
184 # rm -f $i
185 done
186 ) >test_log_smatch 2>&1
187 if [ -f test_log_smatch ]; then
188 lines=`cat test_log_smatch | wc -l`
189 if [ $lines -ne 0 ]; then
190 cat test_log_smatch
191 rm -f test_log_smatch
192 [ -z "$quiet" ] && log_fail $2 ${MAXTEST} "$TEST (smatch)";
193 return 1
194 fi
195 fi
196 [ -z "$quiet" ] && log_ok $2 ${MAXTEST} "$TEST (smatch)";
197 return 0
198 fi
199 [ -z "$quiet" ] && log_skip $2 ${MAXTEST} "$TEST (smatch)";
200 return 0
201}
202
203testmake ()
204{
205
206 fail=0
207 #
208 # Compiler warnings can be OS specific, but at least
209 # on Linux there should be none
210 #
211 isLinux=0
212 uname -a | grep Linux >/dev/null
213 if [ $? -eq 0 ]; then
214 isLinux=1
215 sed --in-place 's/-Wall/-Wall -Werror/' Makefile
216 fi
217 #
218 if test x$1 = x0; then
219 [ -z "$verbose" ] || log_msg_ok "configure... $TEST";
220 $MAKE clean > /dev/null 2>> test_log
221 $MAKE ${SMATCH} cutest > /dev/null 2>> test_log
222 if test x$? = x0; then
223 [ -z "$verbose" ] || log_msg_ok "make cutest... $TEST";
224 else
225 [ -z "$quiet" ] && log_msg_fail "make cutest... $TEST";
226 fail=1
227 fi
228 else
229 [ -z "$quiet" ] && log_msg_fail "configure... $TEST";
230 if [ x"$3" = xskip ]; then
231 [ -z "$quiet" ] && log_skip $2 ${MAXTEST} "$TEST";
232 fi
233 fail=1
234 fi
235 if [ $isLinux -eq 1 ]; then
236 sed --in-place 's/-Wall -Werror/-Wall/' Makefile
237 fi
238 if [ $fail -eq 1 ]; then
239 [ -z "$quiet" ] && log_fail $2 ${MAXTEST} "$TEST";
240 return 1
241 fi
242 [ -z "$quiet" ] && log_ok $2 ${MAXTEST} "$TEST";
243 return 0
244}
245
246testcompile ()
247{
248 log_start "COMPILE"
249
250 if [ "x$doall" = xon ]; then
251 uname -a | grep x86_64 >/dev/null
252 if [ $? -ne 0 ]; then
253 if [ -f /usr/local/gcc-smatch/bin/gcc ]; then # FIXME
254 SAVE_CC="${CC}"
255 SMATCH="DBGDEF=--smatch"; export SMATCH
256 SAVE_SMATCH="${SMATCH}"; export SAVE_SMATCH
257 CC="/usr/local/gcc-smatch/bin/gcc"; export CC
258 SMATCH_CC="${CC}"
259 fi
260 fi
261 fi
262
263 num=0
264 numfail=0
265
266
267 C_LOGFILE=""
268
269 ls /lib/libpcre* >/dev/null 2>&1
270 if [ $? -eq 0 ]; then
271 C_LOGFILE=" --enable-logfile-monitor "
272 else
273 ls /usr/lib/libpcre* >/dev/null 2>&1
274 if [ $? -eq 0 ]; then
275 C_LOGFILE=" --enable-logfile-monitor "
276 else
277 ls /usr/local/lib/libpcre* >/dev/null 2>&1
278 if [ $? -eq 0 ]; then
279 C_LOGFILE=" --enable-logfile-monitor "
280 fi
281 fi
282 fi
283 if [ x"${C_LOGFILE}" = x ]; then
284 log_msg_ok "Not testing --enable-logfile-monitor";
285 fi
286
287 #
288 # test dnmalloc
289 #
290 TEST="${S}check dnmalloc${E}"
291 #
292 ${TOP_SRCDIR}/configure --quiet > /dev/null 2>> test_log
293 #
294 let "num = num + 1" >/dev/null
295 #
296 run_dnmalloc 0 $num || let "numfail = numfail + 1" >/dev/null
297 #
298
299 #
300 # test flawfinder
301 #
302 TEST="${S}check w/flawfinder${E}"
303 #
304 #
305 let "num = num + 1" >/dev/null
306 FLAWFINDER=`find_path flawfinder`
307 #
308 if [ -z "$FLAWFINDER" ]; then
309 log_skip $num $MAXTEST 'check w/flawfinder (not in PATH)'
310 else
311 run_flawfinder 0 $num || let "numfail = numfail + 1" >/dev/null
312 fi
313 #
314
315 #
316 # test standalone compilation
317 #
318 TEST="${S}standalone w/suidcheck w/procchk${E}"
319 #
320 if test -r "Makefile"; then
321 $MAKE distclean
322 fi
323 #
324 ${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
325 #
326 let "num = num + 1" >/dev/null
327 testmake $? $num || let "numfail = numfail + 1" >/dev/null
328 let "num = num + 1" >/dev/null
329 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
330 let "num = num + 1" >/dev/null
331 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
332
333 #
334 # test standalone compilation
335 #
336 TEST="${S}standalone static w/suidcheck w/procchk${E}"
337 #
338 if test -r "Makefile"; then
339 $MAKE distclean
340 fi
341 #
342 [ -z "${SMATCH}" ] || { CC="${SAVE_CC}"; export CC; SMATCH=""; export SMATCH; }
343 #
344 ${TOP_SRCDIR}/configure --quiet --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test --enable-static --enable-suidcheck --enable-process-check ${C_LOGFILE} > /dev/null 2>> test_log
345 #
346 let "num = num + 1" >/dev/null
347 testmake $? $num || let "numfail = numfail + 1" >/dev/null
348 let "num = num + 1" >/dev/null
349 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
350 let "num = num + 1" >/dev/null
351 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
352 #
353 [ -z "${SMATCH_CC}" ] || { CC="${SMATCH_CC}"; export CC; SMATCH="${SAVE_SMATCH}"; export SMATCH; }
354 #
355 # test standalone compilation
356 #
357 TEST="${S}standalone w/procchk w/portchk${E}"
358 #
359 if test -r "Makefile"; then
360 $MAKE distclean
361 fi
362 #
363 ${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
364 #
365 let "num = num + 1" >/dev/null
366 testmake $? $num || let "numfail = numfail + 1" >/dev/null
367 let "num = num + 1" >/dev/null
368 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
369 let "num = num + 1" >/dev/null
370 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
371
372 #
373 # test standalone compilation
374 #
375 TEST="${S}standalone w/procchk w/portchk w/static${E}"
376 #
377 if test -r "Makefile"; then
378 $MAKE distclean
379 fi
380 #
381 [ -z "${SMATCH}" ] || { CC="${SAVE_CC}"; export CC; SMATCH=""; export SMATCH; }
382 #
383 ${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
384 #
385 let "num = num + 1" >/dev/null
386 testmake $? $num || let "numfail = numfail + 1" >/dev/null
387 let "num = num + 1" >/dev/null
388 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
389 let "num = num + 1" >/dev/null
390 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
391 #
392 [ -z "${SMATCH_CC}" ] || { CC="${SMATCH_CC}"; export CC; SMATCH="${SAVE_SMATCH}"; export SMATCH; }
393 #
394 # test standalone compilation
395 #
396 TEST="${S}standalone w/procchk w/portchk w/stealth${E}"
397 #
398 if test -r "Makefile"; then
399 $MAKE distclean
400 fi
401 #
402 ${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
403 #
404 let "num = num + 1" >/dev/null
405 testmake $? $num || let "numfail = numfail + 1" >/dev/null
406 let "num = num + 1" >/dev/null
407 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
408 let "num = num + 1" >/dev/null
409 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
410
411 #
412 # test standalone compilation
413 #
414 TEST="${S}standalone w/mounts-check w/userfiles${E}"
415 #
416 if test -r "Makefile"; then
417 $MAKE distclean
418 fi
419 #
420 ${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
421 #
422 let "num = num + 1" >/dev/null
423 testmake $? $num || let "numfail = numfail + 1" >/dev/null
424 let "num = num + 1" >/dev/null
425 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
426 let "num = num + 1" >/dev/null
427 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
428
429
430 #
431 # test standalone compilation
432 #
433 TEST="${S}standalone w/timeserver and w/msgqueue${E}"
434 #
435 if test -r "Makefile"; then
436 $MAKE clean
437 fi
438 #
439 ${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
440 #
441 let "num = num + 1" >/dev/null
442 testmake $? $num || let "numfail = numfail + 1" >/dev/null
443 let "num = num + 1" >/dev/null
444 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
445 let "num = num + 1" >/dev/null
446 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
447
448 #
449 # test standalone compilation with --with-nocl=PW
450 #
451 TEST="${S}standalone w/nocl w/logmon${E}"
452 #
453 if test -r "Makefile"; then
454 $MAKE clean
455 fi
456 #
457 ${TOP_SRCDIR}/configure --quiet --prefix=$PW_DIR --enable-nocl="owl" --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test ${C_LOGFILE} > /dev/null 2>> test_log
458 #
459 let "num = num + 1" >/dev/null
460 testmake $? $num || let "numfail = numfail + 1" >/dev/null
461 let "num = num + 1" >/dev/null
462 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
463 let "num = num + 1" >/dev/null
464 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
465
466 #
467 # test standalone compilation w/ debug
468 #
469 TEST="${S}standalone w/debug${E}"
470 #
471 if test -r "Makefile"; then
472 $MAKE clean
473 fi
474 #
475 ${TOP_SRCDIR}/configure --quiet --enable-debug --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
476 #
477 let "num = num + 1" >/dev/null
478 testmake $? $num || let "numfail = numfail + 1" >/dev/null
479 let "num = num + 1" >/dev/null
480 run_smatch $? $num debug || let "numfail = numfail + 1" >/dev/null
481 let "num = num + 1" >/dev/null
482 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
483
484 #
485 # test standalone compilation w/ gpg
486 #
487 TEST="${S}standalone w/gpg${E}"
488 #
489 GPG=`find_path gpg`
490 let "num = num + 1" >/dev/null
491 #
492 if [ -z "$GPG" ]; then
493 log_skip $num $MAXTEST 'gpg not in PATH'
494 let "num = num + 1" >/dev/null
495 log_skip $num $MAXTEST 'gpg not in PATH'
496 else
497 if test -r "Makefile"; then
498 $MAKE clean
499 fi
500 #
501 ${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
502 #
503 testmake $? $num || let "numfail = numfail + 1" >/dev/null
504 let "num = num + 1" >/dev/null
505 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
506 let "num = num + 1" >/dev/null
507 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
508 fi
509
510 #
511 # test standalone compilation w/stealth
512 #
513 TEST="${S}standalone w/stealth${E}"
514 #
515 if test -r "Makefile"; then
516 $MAKE clean
517 fi
518 #
519 ${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
520 #
521 let "num = num + 1" >/dev/null
522 testmake $? $num || let "numfail = numfail + 1" >/dev/null
523 let "num = num + 1" >/dev/null
524 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
525 let "num = num + 1" >/dev/null
526 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
527
528 #
529 # test standalone compilation w/loginwatch
530 #
531 TEST="${S}standalone w/login-watch${E}"
532 #
533 if test -r "Makefile"; then
534 $MAKE clean
535 fi
536 #
537 ${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
538 #
539 let "num = num + 1" >/dev/null
540 testmake $? $num || let "numfail = numfail + 1" >/dev/null
541 let "num = num + 1" >/dev/null
542 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
543 let "num = num + 1" >/dev/null
544 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
545
546 #
547 # test standalone compilation w/mysql
548 #
549 TEST="${S}standalone w/mysql${E}"
550 #
551 if test -r "Makefile"; then
552 $MAKE clean
553 fi
554 #
555 ${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
556 #
557 let "num = num + 1" >/dev/null
558 testmake $? $num "skip" || let "numfail = numfail + 1" >/dev/null
559 let "num = num + 1" >/dev/null
560 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
561 let "num = num + 1" >/dev/null
562 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
563
564 #
565 # test standalone compilation w/mysql and stealth
566 #
567 TEST="${S}standalone w/mysql+stealth${E}"
568 #
569 if test -r "Makefile"; then
570 $MAKE clean
571 fi
572 #
573 ${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
574 #
575 let "num = num + 1" >/dev/null
576 testmake $? $num "skip" || let "numfail = numfail + 1" >/dev/null
577 let "num = num + 1" >/dev/null
578 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
579 let "num = num + 1" >/dev/null
580 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
581
582 #
583 # test standalone compilation w/postgresql
584 #
585 TEST="${S}standalone w/postgresql${E}"
586 #
587 if test -r "Makefile"; then
588 $MAKE clean
589 fi
590 #
591 ${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
592 #
593 let "num = num + 1" >/dev/null
594 testmake $? $num "skip" || let "numfail = numfail + 1" >/dev/null
595 let "num = num + 1" >/dev/null
596 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
597 let "num = num + 1" >/dev/null
598 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
599
600 #
601 # test standalone compilation w/postgresql+stealth
602 #
603 TEST="${S}standalone w/postgresql+stealth${E}"
604 #
605 if test -r "Makefile"; then
606 $MAKE clean
607 fi
608 #
609 ${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
610 #
611 let "num = num + 1" >/dev/null
612 testmake $? $num "skip" || let "numfail = numfail + 1" >/dev/null
613 let "num = num + 1" >/dev/null
614 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
615 let "num = num + 1" >/dev/null
616 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
617
618 #
619 # test standalone compilation
620 #
621 TEST="${S}standalone w/o mail w/unix_rnd${E}"
622 #
623 if test -r "Makefile"; then
624 $MAKE clean
625 fi
626 #
627 ${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
628 #
629 let "num = num + 1" >/dev/null
630 testmake $? $num || let "numfail = numfail + 1" >/dev/null
631 let "num = num + 1" >/dev/null
632 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
633 let "num = num + 1" >/dev/null
634 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
635
636 #
637 # test standalone compilation
638 #
639 TEST="${S}standalone w/o external${E}"
640 #
641 if test -r "Makefile"; then
642 $MAKE clean
643 fi
644 #
645 ${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
646 #
647 let "num = num + 1" >/dev/null
648 testmake $? $num || let "numfail = numfail + 1" >/dev/null
649 let "num = num + 1" >/dev/null
650 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
651 let "num = num + 1" >/dev/null
652 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
653
654 # echo; echo "${S}__ TEST CLIENT/SERVER __${E}"; echo;
655
656 #
657 # test client/server compilation
658 #
659 TEST="${S}client/server application w/timeserver${E}"
660 #
661 if test -r "Makefile"; then
662 $MAKE clean
663 fi
664 #
665 ${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
666 #
667 let "num = num + 1" >/dev/null
668 testmake $? $num || let "numfail = numfail + 1" >/dev/null
669 let "num = num + 1" >/dev/null
670 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
671 let "num = num + 1" >/dev/null
672 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
673
674 if test -r "Makefile"; then
675 $MAKE clean
676 fi
677 #
678 ${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
679 #
680 let "num = num + 1" >/dev/null
681 testmake $? $num || let "numfail = numfail + 1" >/dev/null
682 let "num = num + 1" >/dev/null
683 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
684 let "num = num + 1" >/dev/null
685 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
686
687 #
688 # test client/server compilation w/prelude
689 #
690 TEST="${S}client/server application w/prelude${E}"
691 #
692 if [ -z "$doall" ]; then
693 let "num = num + 1" >/dev/null
694 [ -z "$quiet" ] && log_skip $num ${MAXTEST} "$TEST";
695 let "num = num + 1" >/dev/null
696 [ -z "$quiet" ] && log_skip $num ${MAXTEST} "$TEST (smatch)";
697 let "num = num + 1" >/dev/null
698 [ -z "$quiet" ] && log_skip $num ${MAXTEST} "$TEST (uno)";
699
700 let "num = num + 1" >/dev/null
701 [ -z "$quiet" ] && log_skip $num ${MAXTEST} "$TEST";
702 let "num = num + 1" >/dev/null
703 [ -z "$quiet" ] && log_skip $num ${MAXTEST} "$TEST (smatch)";
704 let "num = num + 1" >/dev/null
705 [ -z "$quiet" ] && log_skip $num ${MAXTEST} "$TEST (uno)";
706 else
707 if test -r "Makefile"; then
708 $MAKE clean
709 fi
710 #
711 ${TOP_SRCDIR}/configure --quiet --enable-network=client --enable-srp --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test --with-prelude > /dev/null 2>> test_log
712 #
713 let "num = num + 1" >/dev/null
714 testmake $? $num || let "numfail = numfail + 1" >/dev/null
715 let "num = num + 1" >/dev/null
716 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
717 let "num = num + 1" >/dev/null
718 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
719
720 if test -r "Makefile"; then
721 $MAKE clean
722 fi
723 #
724 ${TOP_SRCDIR}/configure --quiet --enable-network=server --enable-srp --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test --with-prelude > /dev/null 2>> test_log
725 #
726 let "num = num + 1" >/dev/null
727 testmake $? $num || let "numfail = numfail + 1" >/dev/null
728 let "num = num + 1" >/dev/null
729 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
730 let "num = num + 1" >/dev/null
731 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
732 #
733 fi
734
735 #
736 # test client/server compilation
737 #
738 TEST="${S}client/server application static w/timeserver${E}"
739 #
740 if test -r "Makefile"; then
741 $MAKE clean
742 fi
743 #
744 [ -z "${SMATCH}" ] || { CC="${SAVE_CC}"; export CC; SMATCH=""; export SMATCH; }
745 #
746 ${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 ${C_LOGFILE} > /dev/null 2>> test_log
747 #
748 let "num = num + 1" >/dev/null
749 testmake $? $num || let "numfail = numfail + 1" >/dev/null
750 let "num = num + 1" >/dev/null
751 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
752 let "num = num + 1" >/dev/null
753 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
754
755 if test -r "Makefile"; then
756 $MAKE clean
757 fi
758 #
759 ${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
760 #
761 let "num = num + 1" >/dev/null
762 testmake $? $num || let "numfail = numfail + 1" >/dev/null
763 let "num = num + 1" >/dev/null
764 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
765 let "num = num + 1" >/dev/null
766 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
767 #
768 [ -z "${SMATCH_CC}" ] || { CC="${SMATCH_CC}"; export CC; SMATCH="${SAVE_SMATCH}"; export SMATCH; }
769 #
770 # test c/s compilation w/ gpg
771 #
772 TEST="${S}client/server application w/gpg${E}"
773 #
774 GPG=`find_path gpg`
775 let "num = num + 1" >/dev/null
776 #
777 if [ -z "$GPG" ]; then
778 log_skip $num $MAXTEST 'gpg not in PATH'
779 let "num = num + 1" >/dev/null
780 log_skip $num $MAXTEST 'gpg not in PATH'
781 let "num = num + 1" >/dev/null
782 log_skip $num $MAXTEST 'gpg not in PATH'
783 let "num = num + 1" >/dev/null
784 log_skip $num $MAXTEST 'gpg not in PATH'
785 else
786 if test -r "Makefile"; then
787 $MAKE clean
788 fi
789 #
790 ${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
791 #
792 testmake $? $num || let "numfail = numfail + 1" >/dev/null
793 let "num = num + 1" >/dev/null
794 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
795 let "num = num + 1" >/dev/null
796 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
797 #
798 if test -r "Makefile"; then
799 $MAKE clean
800 fi
801 #
802 ${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 ${C_LOGFILE} > /dev/null 2>> test_log
803 #
804 let "num = num + 1" >/dev/null
805 testmake $? $num || let "numfail = numfail + 1" >/dev/null
806 let "num = num + 1" >/dev/null
807 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
808 let "num = num + 1" >/dev/null
809 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
810 fi
811
812
813 #
814 # test client/server compilation
815 #
816 TEST="${S}client/server application w/o srp, w/udp${E}"
817 #
818 if test -r "Makefile"; then
819 $MAKE clean
820 fi
821 #
822 ${TOP_SRCDIR}/configure --quiet --enable-network=server --enable-udp --disable-srp --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
823 #
824 let "num = num + 1" >/dev/null
825 testmake $? $num || let "numfail = numfail + 1" >/dev/null
826 let "num = num + 1" >/dev/null
827 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
828 let "num = num + 1" >/dev/null
829 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
830 #
831 if test -r "Makefile"; then
832 $MAKE clean
833 fi
834 #
835 ${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
836 #
837 let "num = num + 1" >/dev/null
838 testmake $? $num || let "numfail = numfail + 1" >/dev/null
839 let "num = num + 1" >/dev/null
840 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
841 let "num = num + 1" >/dev/null
842 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
843
844 #
845 # test client/server compilation w/ debug
846 #
847 TEST="${S}client/server application w/debug${E}"
848 #
849 if test -r "Makefile"; then
850 $MAKE clean
851 fi
852 #
853 ${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
854 #
855 let "num = num + 1" >/dev/null
856 testmake $? $num || let "numfail = numfail + 1" >/dev/null
857 let "num = num + 1" >/dev/null
858 run_smatch $? $num debug || let "numfail = numfail + 1" >/dev/null
859 let "num = num + 1" >/dev/null
860 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
861 #
862 if test -r "Makefile"; then
863 $MAKE clean
864 fi
865 #
866 ${TOP_SRCDIR}/configure --quiet --enable-network=client --enable-debug --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test ${C_LOGFILE} > /dev/null 2>> test_log
867 #
868 let "num = num + 1" >/dev/null
869 testmake $? $num || let "numfail = numfail + 1" >/dev/null
870 let "num = num + 1" >/dev/null
871 run_smatch $? $num debug || let "numfail = numfail + 1" >/dev/null
872 let "num = num + 1" >/dev/null
873 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
874
875 #
876 # test client/server compilation w/stealth
877 #
878 TEST="${S}client/server application w/stealth${E}"
879 #
880 if test -r "Makefile"; then
881 $MAKE clean
882 fi
883 #
884 ${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
885 #
886 let "num = num + 1" >/dev/null
887 testmake $? $num || let "numfail = numfail + 1" >/dev/null
888 let "num = num + 1" >/dev/null
889 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
890 let "num = num + 1" >/dev/null
891 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
892 #
893 if test -r "Makefile"; then
894 $MAKE clean
895 fi
896 #
897 ${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
898 #
899 let "num = num + 1" >/dev/null
900 testmake $? $num || let "numfail = numfail + 1" >/dev/null
901 let "num = num + 1" >/dev/null
902 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
903 let "num = num + 1" >/dev/null
904 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
905
906 #
907 # test client/server compilation w/logwatch
908 #
909 TEST="${S}client/server application w/login-watch,udp,no_ipv6${E}"
910 #
911 if test -r "Makefile"; then
912 $MAKE clean
913 fi
914 #
915 ${TOP_SRCDIR}/configure --quiet --enable-network=server --enable-udp --disable-ipv6 --enable-srp --enable-login-watch --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
916 #
917 let "num = num + 1" >/dev/null
918 testmake $? $num || let "numfail = numfail + 1" >/dev/null
919 let "num = num + 1" >/dev/null
920 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
921 let "num = num + 1" >/dev/null
922 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
923 #
924 if test -r "Makefile"; then
925 $MAKE clean
926 fi
927 #
928 ${TOP_SRCDIR}/configure --quiet --enable-network=client --disable-ipv6 --enable-srp --enable-login-watch --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
929 #
930 let "num = num + 1" >/dev/null
931 testmake $? $num || let "numfail = numfail + 1" >/dev/null
932 let "num = num + 1" >/dev/null
933 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
934 let "num = num + 1" >/dev/null
935 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
936
937 #
938 # test client/server compilation
939 #
940 TEST="${S}client/server application w/o mail${E}"
941 #
942 if test -r "Makefile"; then
943 $MAKE clean
944 fi
945 #
946 ${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
947 #
948 let "num = num + 1" >/dev/null
949 testmake $? $num || let "numfail = numfail + 1" >/dev/null
950 let "num = num + 1" >/dev/null
951 run_smatch $? $num debug || let "numfail = numfail + 1" >/dev/null
952 let "num = num + 1" >/dev/null
953 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
954 #
955 if test -r "Makefile"; then
956 $MAKE clean
957 fi
958 #
959 ${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
960 #
961 let "num = num + 1" >/dev/null
962 testmake $? $num || let "numfail = numfail + 1" >/dev/null
963 let "num = num + 1" >/dev/null
964 run_smatch $? $num debug || let "numfail = numfail + 1" >/dev/null
965 let "num = num + 1" >/dev/null
966 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
967
968 #
969 # test client/server compilation
970 #
971 TEST="${S}client/server application w/o external${E}"
972 #
973 if test -r "Makefile"; then
974 $MAKE clean
975 fi
976 #
977 ${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
978 #
979 let "num = num + 1" >/dev/null
980 testmake $? $num || let "numfail = numfail + 1" >/dev/null
981 let "num = num + 1" >/dev/null
982 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
983 let "num = num + 1" >/dev/null
984 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
985 #
986 if test -r "Makefile"; then
987 $MAKE clean
988 fi
989 #
990 ${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
991 #
992 let "num = num + 1" >/dev/null
993 testmake $? $num || let "numfail = numfail + 1" >/dev/null
994 let "num = num + 1" >/dev/null
995 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
996 let "num = num + 1" >/dev/null
997 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
998
999 [ -z "${SMATCH}" ] || { CC="${SAVE_CC}"; export CC; }
1000
1001 log_end "COMPILE"
1002}
Note: See TracBrowser for help on using the repository browser.