source: trunk/test/testcompile.sh@ 219

Last change on this file since 219 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
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=110; 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 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
201testmake ()
202{
203 fail=0
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 #
215 if test x$1 = x0; then
216 [ -z "$verbose" ] || log_msg_ok "configure... $TEST";
217 $MAKE clean > /dev/null 2>> test_log
218 $MAKE ${SMATCH} cutest > /dev/null 2>> test_log
219 if test x$? = x0; then
220 [ -z "$verbose" ] || log_msg_ok "make cutest... $TEST";
221 else
222 [ -z "$quiet" ] && log_msg_fail "make cutest... $TEST";
223 fail=1
224 fi
225 else
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
231 fi
232 if [ $isLinux -eq 1 ]; then
233 sed --in-place 's/-Wall -Werror/-Wall/' Makefile
234 fi
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
241}
242
243testcompile ()
244{
245 log_start "COMPILE"
246
247 if [ "x$doall" = xon ]; then
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
257 fi
258 fi
259
260 num=0
261 numfail=0
262
263 #
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 #
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 #
292 # test standalone compilation
293 #
294 TEST="${S}standalone w/suidcheck w/procchk${E}"
295 #
296 if test -r "Makefile"; then
297 $MAKE distclean
298 fi
299 #
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
301 #
302 let "num = num + 1" >/dev/null
303 testmake $? $num || let "numfail = numfail + 1" >/dev/null
304 let "num = num + 1" >/dev/null
305 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
306 let "num = num + 1" >/dev/null
307 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
308
309 #
310 # test standalone compilation
311 #
312 TEST="${S}standalone static w/suidcheck w/procchk${E}"
313 #
314 if test -r "Makefile"; then
315 $MAKE distclean
316 fi
317 #
318 [ -z "${SMATCH}" ] || { CC="${SAVE_CC}"; export CC; SMATCH=""; export SMATCH; }
319 #
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
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
326 let "num = num + 1" >/dev/null
327 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
328 #
329 [ -z "${SMATCH_CC}" ] || { CC="${SMATCH_CC}"; export CC; SMATCH="${SAVE_SMATCH}"; export SMATCH; }
330 #
331 # test standalone compilation
332 #
333 TEST="${S}standalone w/procchk w/portchk${E}"
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
345 let "num = num + 1" >/dev/null
346 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
347
348 #
349 # test standalone compilation
350 #
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 #
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
381 let "num = num + 1" >/dev/null
382 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
383
384 #
385 # test standalone compilation
386 #
387 TEST="${S}standalone w/mounts-check w/userfiles${E}"
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 #
395 let "num = num + 1" >/dev/null
396 testmake $? $num || let "numfail = numfail + 1" >/dev/null
397 let "num = num + 1" >/dev/null
398 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
399 let "num = num + 1" >/dev/null
400 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
401
402
403 #
404 # test standalone compilation
405 #
406 TEST="${S}standalone w/timeserver and w/msgqueue${E}"
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 #
414 let "num = num + 1" >/dev/null
415 testmake $? $num || let "numfail = numfail + 1" >/dev/null
416 let "num = num + 1" >/dev/null
417 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
418 let "num = num + 1" >/dev/null
419 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
420
421 #
422 # test standalone compilation with --with-nocl=PW
423 #
424 TEST="${S}standalone w/nocl w/logmon${E}"
425 #
426 if test -r "Makefile"; then
427 $MAKE clean
428 fi
429 #
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
431 #
432 let "num = num + 1" >/dev/null
433 testmake $? $num || let "numfail = numfail + 1" >/dev/null
434 let "num = num + 1" >/dev/null
435 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
436 let "num = num + 1" >/dev/null
437 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
438
439 #
440 # test standalone compilation w/ debug
441 #
442 TEST="${S}standalone w/debug${E}"
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 #
450 let "num = num + 1" >/dev/null
451 testmake $? $num || let "numfail = numfail + 1" >/dev/null
452 let "num = num + 1" >/dev/null
453 run_smatch $? $num debug || let "numfail = numfail + 1" >/dev/null
454 let "num = num + 1" >/dev/null
455 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
456
457 #
458 # test standalone compilation w/ gpg
459 #
460 TEST="${S}standalone w/gpg${E}"
461 #
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'
467 let "num = num + 1" >/dev/null
468 log_skip $num $MAXTEST 'gpg not in PATH'
469 else
470 if test -r "Makefile"; then
471 $MAKE clean
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
477 let "num = num + 1" >/dev/null
478 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
479 let "num = num + 1" >/dev/null
480 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
481 fi
482
483 #
484 # test standalone compilation w/stealth
485 #
486 TEST="${S}standalone w/stealth${E}"
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 #
494 let "num = num + 1" >/dev/null
495 testmake $? $num || let "numfail = numfail + 1" >/dev/null
496 let "num = num + 1" >/dev/null
497 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
498 let "num = num + 1" >/dev/null
499 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
500
501 #
502 # test standalone compilation w/loginwatch
503 #
504 TEST="${S}standalone w/login-watch${E}"
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 #
512 let "num = num + 1" >/dev/null
513 testmake $? $num || let "numfail = numfail + 1" >/dev/null
514 let "num = num + 1" >/dev/null
515 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
516 let "num = num + 1" >/dev/null
517 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
518
519 #
520 # test standalone compilation w/mysql
521 #
522 TEST="${S}standalone w/mysql${E}"
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
532 let "num = num + 1" >/dev/null
533 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
534 let "num = num + 1" >/dev/null
535 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
536
537 #
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
552 let "num = num + 1" >/dev/null
553 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
554
555 #
556 # test standalone compilation w/postgresql
557 #
558 TEST="${S}standalone w/postgresql${E}"
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
568 let "num = num + 1" >/dev/null
569 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
570 let "num = num + 1" >/dev/null
571 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
572
573 #
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
588 let "num = num + 1" >/dev/null
589 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
590
591 #
592 # test standalone compilation
593 #
594 TEST="${S}standalone w/o mail w/unix_rnd${E}"
595 #
596 if test -r "Makefile"; then
597 $MAKE clean
598 fi
599 #
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
601 #
602 let "num = num + 1" >/dev/null
603 testmake $? $num || let "numfail = numfail + 1" >/dev/null
604 let "num = num + 1" >/dev/null
605 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
606 let "num = num + 1" >/dev/null
607 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
608
609 #
610 # test standalone compilation
611 #
612 TEST="${S}standalone w/o external${E}"
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 #
620 let "num = num + 1" >/dev/null
621 testmake $? $num || let "numfail = numfail + 1" >/dev/null
622 let "num = num + 1" >/dev/null
623 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
624 let "num = num + 1" >/dev/null
625 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
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 #
640 let "num = num + 1" >/dev/null
641 testmake $? $num || let "numfail = numfail + 1" >/dev/null
642 let "num = num + 1" >/dev/null
643 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
644 let "num = num + 1" >/dev/null
645 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
646
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 #
653 let "num = num + 1" >/dev/null
654 testmake $? $num || let "numfail = numfail + 1" >/dev/null
655 let "num = num + 1" >/dev/null
656 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
657 let "num = num + 1" >/dev/null
658 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
659
660 #
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 #
669 [ -z "${SMATCH}" ] || { CC="${SAVE_CC}"; export CC; SMATCH=""; export SMATCH; }
670 #
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
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
677 let "num = num + 1" >/dev/null
678 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
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
690 let "num = num + 1" >/dev/null
691 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
692 #
693 [ -z "${SMATCH_CC}" ] || { CC="${SMATCH_CC}"; export CC; SMATCH="${SAVE_SMATCH}"; export SMATCH; }
694 #
695 # test c/s compilation w/ gpg
696 #
697 TEST="${S}client/server application w/gpg${E}"
698 #
699 GPG=`find_path gpg`
700 let "num = num + 1" >/dev/null
701 #
702 if [ -z "$GPG" ]; then
703 log_skip $num $MAXTEST 'gpg not in PATH'
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'
710 else
711 if test -r "Makefile"; then
712 $MAKE clean
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
718 let "num = num + 1" >/dev/null
719 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
720 let "num = num + 1" >/dev/null
721 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
722 #
723 if test -r "Makefile"; then
724 $MAKE clean
725 fi
726 #
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
728 #
729 let "num = num + 1" >/dev/null
730 testmake $? $num || let "numfail = numfail + 1" >/dev/null
731 let "num = num + 1" >/dev/null
732 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
733 let "num = num + 1" >/dev/null
734 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
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 #
749 let "num = num + 1" >/dev/null
750 testmake $? $num || let "numfail = numfail + 1" >/dev/null
751 let "num = num + 1" >/dev/null
752 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
753 let "num = num + 1" >/dev/null
754 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
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 #
762 let "num = num + 1" >/dev/null
763 testmake $? $num || let "numfail = numfail + 1" >/dev/null
764 let "num = num + 1" >/dev/null
765 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
766 let "num = num + 1" >/dev/null
767 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
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 #
780 let "num = num + 1" >/dev/null
781 testmake $? $num || let "numfail = numfail + 1" >/dev/null
782 let "num = num + 1" >/dev/null
783 run_smatch $? $num debug || let "numfail = numfail + 1" >/dev/null
784 let "num = num + 1" >/dev/null
785 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
786 #
787 if test -r "Makefile"; then
788 $MAKE clean
789 fi
790 #
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
792 #
793 let "num = num + 1" >/dev/null
794 testmake $? $num || let "numfail = numfail + 1" >/dev/null
795 let "num = num + 1" >/dev/null
796 run_smatch $? $num debug || let "numfail = numfail + 1" >/dev/null
797 let "num = num + 1" >/dev/null
798 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
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 #
811 let "num = num + 1" >/dev/null
812 testmake $? $num || let "numfail = numfail + 1" >/dev/null
813 let "num = num + 1" >/dev/null
814 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
815 let "num = num + 1" >/dev/null
816 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
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 #
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 #
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 #
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 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 #
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 || 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 #
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 #
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 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 #
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 debug || 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 #
894 # test client/server compilation
895 #
896 TEST="${S}client/server application w/o external${E}"
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 #
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 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 #
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 [ -z "${SMATCH}" ] || { CC="${SAVE_CC}"; export CC; }
925
926 log_end "COMPILE"
927}
Note: See TracBrowser for help on using the repository browser.