source: trunk/test/testcompile.sh@ 470

Last change on this file since 470 was 378, checked in by katerina, 13 years ago

Fix for tickets #273 (deadlock), #274 (compile errors), #275 (makefile), #276 (config.sub, config.guess).

File size: 32.6 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/lib/*/libpcre* >/dev/null 2>&1
278 if [ $? -eq 0 ]; then
279 C_LOGFILE=" --enable-logfile-monitor "
280 else
281 ls /usr/local/lib/libpcre* >/dev/null 2>&1
282 if [ $? -eq 0 ]; then
283 C_LOGFILE=" --enable-logfile-monitor "
284 fi
285 fi
286 fi
287 fi
288 if [ x"${C_LOGFILE}" = x ]; then
289 log_msg_ok "Not testing --enable-logfile-monitor";
290 fi
291
292 #
293 # test dnmalloc
294 #
295 TEST="${S}check dnmalloc${E}"
296 #
297 ${TOP_SRCDIR}/configure --quiet > /dev/null 2>> test_log
298 #
299 let "num = num + 1" >/dev/null
300 #
301 run_dnmalloc 0 $num || let "numfail = numfail + 1" >/dev/null
302 #
303
304 #
305 # test flawfinder
306 #
307 TEST="${S}check w/flawfinder${E}"
308 #
309 #
310 let "num = num + 1" >/dev/null
311 FLAWFINDER=`find_path flawfinder`
312 #
313 if [ -z "$FLAWFINDER" ]; then
314 log_skip $num $MAXTEST 'check w/flawfinder (not in PATH)'
315 else
316 run_flawfinder 0 $num || let "numfail = numfail + 1" >/dev/null
317 fi
318 #
319
320 #
321 # test standalone compilation
322 #
323 TEST="${S}standalone w/suidcheck w/procchk${E}"
324 #
325 if test -r "Makefile"; then
326 $MAKE distclean
327 fi
328 #
329 ${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
330 #
331 let "num = num + 1" >/dev/null
332 testmake $? $num || let "numfail = numfail + 1" >/dev/null
333 let "num = num + 1" >/dev/null
334 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
335 let "num = num + 1" >/dev/null
336 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
337
338 #
339 # test standalone compilation
340 #
341 TEST="${S}standalone static w/suidcheck w/procchk${E}"
342 #
343 if test -r "Makefile"; then
344 $MAKE distclean
345 fi
346 #
347 [ -z "${SMATCH}" ] || { CC="${SAVE_CC}"; export CC; SMATCH=""; export SMATCH; }
348 #
349 ${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
350 #
351 let "num = num + 1" >/dev/null
352 testmake $? $num || let "numfail = numfail + 1" >/dev/null
353 let "num = num + 1" >/dev/null
354 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
355 let "num = num + 1" >/dev/null
356 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
357 #
358 [ -z "${SMATCH_CC}" ] || { CC="${SMATCH_CC}"; export CC; SMATCH="${SAVE_SMATCH}"; export SMATCH; }
359 #
360 # test standalone compilation
361 #
362 TEST="${S}standalone w/procchk w/portchk${E}"
363 #
364 if test -r "Makefile"; then
365 $MAKE distclean
366 fi
367 #
368 ${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
369 #
370 let "num = num + 1" >/dev/null
371 testmake $? $num || let "numfail = numfail + 1" >/dev/null
372 let "num = num + 1" >/dev/null
373 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
374 let "num = num + 1" >/dev/null
375 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
376
377 #
378 # test standalone compilation
379 #
380 TEST="${S}standalone w/procchk w/portchk w/static${E}"
381 #
382 if test -r "Makefile"; then
383 $MAKE distclean
384 fi
385 #
386 [ -z "${SMATCH}" ] || { CC="${SAVE_CC}"; export CC; SMATCH=""; export SMATCH; }
387 #
388 ${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
389 #
390 let "num = num + 1" >/dev/null
391 testmake $? $num || let "numfail = numfail + 1" >/dev/null
392 let "num = num + 1" >/dev/null
393 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
394 let "num = num + 1" >/dev/null
395 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
396 #
397 [ -z "${SMATCH_CC}" ] || { CC="${SMATCH_CC}"; export CC; SMATCH="${SAVE_SMATCH}"; export SMATCH; }
398 #
399 # test standalone compilation
400 #
401 TEST="${S}standalone w/procchk w/portchk w/stealth${E}"
402 #
403 if test -r "Makefile"; then
404 $MAKE distclean
405 fi
406 #
407 ${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
408 #
409 let "num = num + 1" >/dev/null
410 testmake $? $num || let "numfail = numfail + 1" >/dev/null
411 let "num = num + 1" >/dev/null
412 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
413 let "num = num + 1" >/dev/null
414 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
415
416 #
417 # test standalone compilation
418 #
419 TEST="${S}standalone w/mounts-check w/userfiles${E}"
420 #
421 if test -r "Makefile"; then
422 $MAKE distclean
423 fi
424 #
425 ${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
426 #
427 let "num = num + 1" >/dev/null
428 testmake $? $num || let "numfail = numfail + 1" >/dev/null
429 let "num = num + 1" >/dev/null
430 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
431 let "num = num + 1" >/dev/null
432 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
433
434
435 #
436 # test standalone compilation
437 #
438 TEST="${S}standalone w/timeserver and w/msgqueue${E}"
439 #
440 if test -r "Makefile"; then
441 $MAKE clean
442 fi
443 #
444 ${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
445 #
446 let "num = num + 1" >/dev/null
447 testmake $? $num || let "numfail = numfail + 1" >/dev/null
448 let "num = num + 1" >/dev/null
449 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
450 let "num = num + 1" >/dev/null
451 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
452
453 #
454 # test standalone compilation with --with-nocl=PW
455 #
456 TEST="${S}standalone w/nocl w/logmon${E}"
457 #
458 if test -r "Makefile"; then
459 $MAKE clean
460 fi
461 #
462 ${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
463 #
464 let "num = num + 1" >/dev/null
465 testmake $? $num || let "numfail = numfail + 1" >/dev/null
466 let "num = num + 1" >/dev/null
467 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
468 let "num = num + 1" >/dev/null
469 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
470
471 #
472 # test standalone compilation w/ debug
473 #
474 TEST="${S}standalone w/debug${E}"
475 #
476 if test -r "Makefile"; then
477 $MAKE clean
478 fi
479 #
480 ${TOP_SRCDIR}/configure --quiet --enable-debug --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
481 #
482 let "num = num + 1" >/dev/null
483 testmake $? $num || let "numfail = numfail + 1" >/dev/null
484 let "num = num + 1" >/dev/null
485 run_smatch $? $num debug || let "numfail = numfail + 1" >/dev/null
486 let "num = num + 1" >/dev/null
487 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
488
489 #
490 # test standalone compilation w/ gpg
491 #
492 TEST="${S}standalone w/gpg${E}"
493 #
494 GPG=`find_path gpg`
495 let "num = num + 1" >/dev/null
496 #
497 if [ -z "$GPG" ]; then
498 log_skip $num $MAXTEST 'gpg not in PATH'
499 let "num = num + 1" >/dev/null
500 log_skip $num $MAXTEST 'gpg not in PATH'
501 else
502 if test -r "Makefile"; then
503 $MAKE clean
504 fi
505 #
506 ${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
507 #
508 testmake $? $num || let "numfail = numfail + 1" >/dev/null
509 let "num = num + 1" >/dev/null
510 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
511 let "num = num + 1" >/dev/null
512 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
513 fi
514
515 #
516 # test standalone compilation w/stealth
517 #
518 TEST="${S}standalone w/stealth${E}"
519 #
520 if test -r "Makefile"; then
521 $MAKE clean
522 fi
523 #
524 ${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
525 #
526 let "num = num + 1" >/dev/null
527 testmake $? $num || let "numfail = numfail + 1" >/dev/null
528 let "num = num + 1" >/dev/null
529 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
530 let "num = num + 1" >/dev/null
531 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
532
533 #
534 # test standalone compilation w/loginwatch
535 #
536 TEST="${S}standalone w/login-watch${E}"
537 #
538 if test -r "Makefile"; then
539 $MAKE clean
540 fi
541 #
542 ${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
543 #
544 let "num = num + 1" >/dev/null
545 testmake $? $num || let "numfail = numfail + 1" >/dev/null
546 let "num = num + 1" >/dev/null
547 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
548 let "num = num + 1" >/dev/null
549 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
550
551 #
552 # test standalone compilation w/mysql
553 #
554 TEST="${S}standalone w/mysql${E}"
555 #
556 if test -r "Makefile"; then
557 $MAKE clean
558 fi
559 #
560 ${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
561 #
562 let "num = num + 1" >/dev/null
563 testmake $? $num "skip" || let "numfail = numfail + 1" >/dev/null
564 let "num = num + 1" >/dev/null
565 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
566 let "num = num + 1" >/dev/null
567 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
568
569 #
570 # test standalone compilation w/mysql and stealth
571 #
572 TEST="${S}standalone w/mysql+stealth${E}"
573 #
574 if test -r "Makefile"; then
575 $MAKE clean
576 fi
577 #
578 ${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
579 #
580 let "num = num + 1" >/dev/null
581 testmake $? $num "skip" || let "numfail = numfail + 1" >/dev/null
582 let "num = num + 1" >/dev/null
583 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
584 let "num = num + 1" >/dev/null
585 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
586
587 #
588 # test standalone compilation w/postgresql
589 #
590 TEST="${S}standalone w/postgresql${E}"
591 #
592 if test -r "Makefile"; then
593 $MAKE clean
594 fi
595 #
596 ${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
597 #
598 let "num = num + 1" >/dev/null
599 testmake $? $num "skip" || let "numfail = numfail + 1" >/dev/null
600 let "num = num + 1" >/dev/null
601 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
602 let "num = num + 1" >/dev/null
603 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
604
605 #
606 # test standalone compilation w/postgresql+stealth
607 #
608 TEST="${S}standalone w/postgresql+stealth${E}"
609 #
610 if test -r "Makefile"; then
611 $MAKE clean
612 fi
613 #
614 ${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
615 #
616 let "num = num + 1" >/dev/null
617 testmake $? $num "skip" || let "numfail = numfail + 1" >/dev/null
618 let "num = num + 1" >/dev/null
619 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
620 let "num = num + 1" >/dev/null
621 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
622
623 #
624 # test standalone compilation
625 #
626 TEST="${S}standalone w/o mail w/unix_rnd${E}"
627 #
628 if test -r "Makefile"; then
629 $MAKE clean
630 fi
631 #
632 ${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
633 #
634 let "num = num + 1" >/dev/null
635 testmake $? $num || let "numfail = numfail + 1" >/dev/null
636 let "num = num + 1" >/dev/null
637 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
638 let "num = num + 1" >/dev/null
639 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
640
641 #
642 # test standalone compilation
643 #
644 TEST="${S}standalone w/o external${E}"
645 #
646 if test -r "Makefile"; then
647 $MAKE clean
648 fi
649 #
650 ${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
651 #
652 let "num = num + 1" >/dev/null
653 testmake $? $num || let "numfail = numfail + 1" >/dev/null
654 let "num = num + 1" >/dev/null
655 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
656 let "num = num + 1" >/dev/null
657 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
658
659 # echo; echo "${S}__ TEST CLIENT/SERVER __${E}"; echo;
660
661 #
662 # test client/server compilation
663 #
664 TEST="${S}client/server application w/timeserver${E}"
665 #
666 if test -r "Makefile"; then
667 $MAKE clean
668 fi
669 #
670 ${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
671 #
672 let "num = num + 1" >/dev/null
673 testmake $? $num || let "numfail = numfail + 1" >/dev/null
674 let "num = num + 1" >/dev/null
675 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
676 let "num = num + 1" >/dev/null
677 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
678
679 if test -r "Makefile"; then
680 $MAKE clean
681 fi
682 #
683 ${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
684 #
685 let "num = num + 1" >/dev/null
686 testmake $? $num || let "numfail = numfail + 1" >/dev/null
687 let "num = num + 1" >/dev/null
688 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
689 let "num = num + 1" >/dev/null
690 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
691
692 #
693 # test client/server compilation w/prelude
694 #
695 TEST="${S}client/server application w/prelude${E}"
696 #
697 if [ -z "$doall" ]; then
698 let "num = num + 1" >/dev/null
699 [ -z "$quiet" ] && log_skip $num ${MAXTEST} "$TEST";
700 let "num = num + 1" >/dev/null
701 [ -z "$quiet" ] && log_skip $num ${MAXTEST} "$TEST (smatch)";
702 let "num = num + 1" >/dev/null
703 [ -z "$quiet" ] && log_skip $num ${MAXTEST} "$TEST (uno)";
704
705 let "num = num + 1" >/dev/null
706 [ -z "$quiet" ] && log_skip $num ${MAXTEST} "$TEST";
707 let "num = num + 1" >/dev/null
708 [ -z "$quiet" ] && log_skip $num ${MAXTEST} "$TEST (smatch)";
709 let "num = num + 1" >/dev/null
710 [ -z "$quiet" ] && log_skip $num ${MAXTEST} "$TEST (uno)";
711 else
712 if test -r "Makefile"; then
713 $MAKE clean
714 fi
715 #
716 ${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
717 #
718 let "num = num + 1" >/dev/null
719 testmake $? $num || let "numfail = numfail + 1" >/dev/null
720 let "num = num + 1" >/dev/null
721 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
722 let "num = num + 1" >/dev/null
723 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
724
725 if test -r "Makefile"; then
726 $MAKE clean
727 fi
728 #
729 ${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
730 #
731 let "num = num + 1" >/dev/null
732 testmake $? $num || let "numfail = numfail + 1" >/dev/null
733 let "num = num + 1" >/dev/null
734 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
735 let "num = num + 1" >/dev/null
736 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
737 #
738 fi
739
740 #
741 # test client/server compilation
742 #
743 TEST="${S}client/server application static w/timeserver${E}"
744 #
745 if test -r "Makefile"; then
746 $MAKE clean
747 fi
748 #
749 [ -z "${SMATCH}" ] || { CC="${SAVE_CC}"; export CC; SMATCH=""; export SMATCH; }
750 #
751 ${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
752 #
753 let "num = num + 1" >/dev/null
754 testmake $? $num || let "numfail = numfail + 1" >/dev/null
755 let "num = num + 1" >/dev/null
756 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
757 let "num = num + 1" >/dev/null
758 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
759
760 if test -r "Makefile"; then
761 $MAKE clean
762 fi
763 #
764 ${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
765 #
766 let "num = num + 1" >/dev/null
767 testmake $? $num || let "numfail = numfail + 1" >/dev/null
768 let "num = num + 1" >/dev/null
769 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
770 let "num = num + 1" >/dev/null
771 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
772 #
773 [ -z "${SMATCH_CC}" ] || { CC="${SMATCH_CC}"; export CC; SMATCH="${SAVE_SMATCH}"; export SMATCH; }
774 #
775 # test c/s compilation w/ gpg
776 #
777 TEST="${S}client/server application w/gpg${E}"
778 #
779 GPG=`find_path gpg`
780 let "num = num + 1" >/dev/null
781 #
782 if [ -z "$GPG" ]; then
783 log_skip $num $MAXTEST 'gpg not in PATH'
784 let "num = num + 1" >/dev/null
785 log_skip $num $MAXTEST 'gpg not in PATH'
786 let "num = num + 1" >/dev/null
787 log_skip $num $MAXTEST 'gpg not in PATH'
788 let "num = num + 1" >/dev/null
789 log_skip $num $MAXTEST 'gpg not in PATH'
790 else
791 if test -r "Makefile"; then
792 $MAKE clean
793 fi
794 #
795 ${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
796 #
797 testmake $? $num || let "numfail = numfail + 1" >/dev/null
798 let "num = num + 1" >/dev/null
799 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
800 let "num = num + 1" >/dev/null
801 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
802 #
803 if test -r "Makefile"; then
804 $MAKE clean
805 fi
806 #
807 ${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
808 #
809 let "num = num + 1" >/dev/null
810 testmake $? $num || let "numfail = numfail + 1" >/dev/null
811 let "num = num + 1" >/dev/null
812 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
813 let "num = num + 1" >/dev/null
814 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
815 fi
816
817
818 #
819 # test client/server compilation
820 #
821 TEST="${S}client/server application w/o srp, w/udp${E}"
822 #
823 if test -r "Makefile"; then
824 $MAKE clean
825 fi
826 #
827 ${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
828 #
829 let "num = num + 1" >/dev/null
830 testmake $? $num || let "numfail = numfail + 1" >/dev/null
831 let "num = num + 1" >/dev/null
832 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
833 let "num = num + 1" >/dev/null
834 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
835 #
836 if test -r "Makefile"; then
837 $MAKE clean
838 fi
839 #
840 ${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
841 #
842 let "num = num + 1" >/dev/null
843 testmake $? $num || let "numfail = numfail + 1" >/dev/null
844 let "num = num + 1" >/dev/null
845 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
846 let "num = num + 1" >/dev/null
847 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
848
849 #
850 # test client/server compilation w/ debug
851 #
852 TEST="${S}client/server application w/debug${E}"
853 #
854 if test -r "Makefile"; then
855 $MAKE clean
856 fi
857 #
858 ${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
859 #
860 let "num = num + 1" >/dev/null
861 testmake $? $num || let "numfail = numfail + 1" >/dev/null
862 let "num = num + 1" >/dev/null
863 run_smatch $? $num debug || let "numfail = numfail + 1" >/dev/null
864 let "num = num + 1" >/dev/null
865 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
866 #
867 if test -r "Makefile"; then
868 $MAKE clean
869 fi
870 #
871 ${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
872 #
873 let "num = num + 1" >/dev/null
874 testmake $? $num || let "numfail = numfail + 1" >/dev/null
875 let "num = num + 1" >/dev/null
876 run_smatch $? $num debug || let "numfail = numfail + 1" >/dev/null
877 let "num = num + 1" >/dev/null
878 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
879
880 #
881 # test client/server compilation w/stealth
882 #
883 TEST="${S}client/server application w/stealth${E}"
884 #
885 if test -r "Makefile"; then
886 $MAKE clean
887 fi
888 #
889 ${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
890 #
891 let "num = num + 1" >/dev/null
892 testmake $? $num || let "numfail = numfail + 1" >/dev/null
893 let "num = num + 1" >/dev/null
894 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
895 let "num = num + 1" >/dev/null
896 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
897 #
898 if test -r "Makefile"; then
899 $MAKE clean
900 fi
901 #
902 ${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
903 #
904 let "num = num + 1" >/dev/null
905 testmake $? $num || let "numfail = numfail + 1" >/dev/null
906 let "num = num + 1" >/dev/null
907 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
908 let "num = num + 1" >/dev/null
909 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
910
911 #
912 # test client/server compilation w/logwatch
913 #
914 TEST="${S}client/server application w/login-watch,udp,no_ipv6${E}"
915 #
916 if test -r "Makefile"; then
917 $MAKE clean
918 fi
919 #
920 ${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
921 #
922 let "num = num + 1" >/dev/null
923 testmake $? $num || let "numfail = numfail + 1" >/dev/null
924 let "num = num + 1" >/dev/null
925 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
926 let "num = num + 1" >/dev/null
927 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
928 #
929 if test -r "Makefile"; then
930 $MAKE clean
931 fi
932 #
933 ${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
934 #
935 let "num = num + 1" >/dev/null
936 testmake $? $num || let "numfail = numfail + 1" >/dev/null
937 let "num = num + 1" >/dev/null
938 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
939 let "num = num + 1" >/dev/null
940 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
941
942 #
943 # test client/server compilation
944 #
945 TEST="${S}client/server application w/o mail${E}"
946 #
947 if test -r "Makefile"; then
948 $MAKE clean
949 fi
950 #
951 ${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
952 #
953 let "num = num + 1" >/dev/null
954 testmake $? $num || let "numfail = numfail + 1" >/dev/null
955 let "num = num + 1" >/dev/null
956 run_smatch $? $num debug || let "numfail = numfail + 1" >/dev/null
957 let "num = num + 1" >/dev/null
958 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
959 #
960 if test -r "Makefile"; then
961 $MAKE clean
962 fi
963 #
964 ${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
965 #
966 let "num = num + 1" >/dev/null
967 testmake $? $num || let "numfail = numfail + 1" >/dev/null
968 let "num = num + 1" >/dev/null
969 run_smatch $? $num debug || let "numfail = numfail + 1" >/dev/null
970 let "num = num + 1" >/dev/null
971 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
972
973 #
974 # test client/server compilation
975 #
976 TEST="${S}client/server application w/o external${E}"
977 #
978 if test -r "Makefile"; then
979 $MAKE clean
980 fi
981 #
982 ${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
983 #
984 let "num = num + 1" >/dev/null
985 testmake $? $num || let "numfail = numfail + 1" >/dev/null
986 let "num = num + 1" >/dev/null
987 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
988 let "num = num + 1" >/dev/null
989 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
990 #
991 if test -r "Makefile"; then
992 $MAKE clean
993 fi
994 #
995 ${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
996 #
997 let "num = num + 1" >/dev/null
998 testmake $? $num || let "numfail = numfail + 1" >/dev/null
999 let "num = num + 1" >/dev/null
1000 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
1001 let "num = num + 1" >/dev/null
1002 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
1003
1004 [ -z "${SMATCH}" ] || { CC="${SAVE_CC}"; export CC; }
1005
1006 log_end "COMPILE"
1007}
Note: See TracBrowser for help on using the repository browser.