source: trunk/test/testcompile.sh@ 249

Last change on this file since 249 was 227, checked in by katerina, 16 years ago

Fix warnings with -fstack-check

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