source: trunk/test/testcompile.sh@ 556

Last change on this file since 556 was 539, checked in by katerina, 6 years ago

Fixes for tickets #431 (OpenBSD compatibility) and #432 (compiler warnings).

File size: 27.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 + cppcheck + flawfinder + (38 * 2) - 8
23MAXTEST=79; export MAXTEST
24
25run_dnmalloc ()
26{
27 uname -a | grep -i openbsd >/dev/null
28
29 if test x$? = x0; then
30 log_skip $num ${MAXTEST} 'test dnmalloc'
31 return 0
32 fi
33
34 fail=0
35 if test x$1 = x0; then
36 [ -z "$verbose" ] || log_msg_ok "configure...";
37 $MAKE clean > /dev/null 2>> test_log
38 $MAKE test_dnmalloc > /dev/null 2>> test_log
39 if test x$? = x0; then
40 [ -z "$verbose" ] || log_msg_ok "make test_dnmalloc...";
41 else
42 [ -z "$quiet" ] && log_msg_fail "make test_dnmalloc...";
43 fail=1
44 fi
45 else
46 [ -z "$quiet" ] && log_msg_fail "configure...";
47 if [ x"$3" = xskip ]; then
48 [ -z "$quiet" ] && log_skip $2 ${MAXTEST} "test dnmalloc";
49 fi
50 fail=1
51 fi
52 if [ $fail -eq 1 ]; then
53 [ -z "$quiet" ] && log_fail $2 ${MAXTEST} "test dnmalloc";
54 return 1
55 fi
56 #
57 fail=0
58 ./test_dnmalloc >/dev/null
59 if test x$? = x0; then
60 [ -z "$verbose" ] || log_msg_ok "run 1 completed...";
61 ./test_dnmalloc 300 12 3000 150000 400 >/dev/null
62 if test x$? = x0; then
63 [ -z "$verbose" ] || log_msg_ok "run 2 completed...";
64 ./test_dnmalloc 1 1 4000 10000000 1000 >/dev/null
65 if test x$? = x0; then
66 [ -z "$verbose" ] || log_msg_ok "run 3 completed...";
67 ./test_dnmalloc 1 1 4000 10000000 1000 >/dev/null
68 if test x$? = x0; then
69 [ -z "$verbose" ] || log_msg_ok "run 4 completed...";
70 else
71 fail=1
72 fi
73 else
74 fail=1
75 fi
76 else
77 fail=1
78 fi
79 else
80 fail=1
81 fi
82 #
83 if test x$fail = x0; then
84 [ -z "$quiet" ] && log_ok $2 ${MAXTEST} "test dnmalloc";
85 return 0
86 else
87 [ -z "$quiet" ] && log_fail $2 ${MAXTEST} "test dnmalloc";
88 return 1
89 fi
90}
91
92run_cppcheck ()
93{
94 #
95 CPC=`find_path cppcheck`
96 #
97 if [ -z "$CPC" ]; then
98 log_skip $num ${MAXTEST} 'check w/cppcheck (not in PATH)'
99 return 0
100 fi
101 #
102 cd src/
103 stat=`cppcheck --quiet --library=posix.cfg --inline-suppr --force -j 4 --template="{file},{line},{severity},{id},{message}" -I. -I.. -I../include sh_*.c samhain.c slib.c dnmalloc.c zAVLTree.c trustfile.c rijndael-*.c bignum.c 2>&1 | wc -l`
104 if [ $stat -ne 0 ]; then
105 cppcheck --quiet --library=posix.cfg --inline-suppr --force -j 4 --template="{file},{line},{severity},{id},{message}" -I. -I.. -I../include sh_*.c samhain.c slib.c dnmalloc.c zAVLTree.c trustfile.c rijndael-*.c bignum.c >>../test_log 2>&1
106 retval=1
107 [ -z "$quiet" ] && log_fail $2 ${MAXTEST} "check w/cppcheck";
108 else
109 retval=0
110 [ -z "$quiet" ] && log_ok $2 ${MAXTEST} "check w/cppcheck";
111 fi
112 cd ..
113 return $retval
114}
115
116run_flawfinder ()
117{
118 flawfinder --minlevel=3 --quiet src/s*.c | \
119 egrep '^No hits found.' >/dev/null 2>&1
120 if [ $? -eq 0 ]; then
121 [ -z "$quiet" ] && log_ok $2 ${MAXTEST} "$TEST";
122 else
123 flawfinder --minlevel=3 --quiet src/s*.c >test_log 2>&1
124 [ -z "$quiet" ] && log_fail $2 ${MAXTEST} "$TEST";
125 return 1
126 fi
127}
128
129run_clang ()
130{
131 export CDIR=`pwd`;
132
133 if [ -z "$doall" ]; then
134 [ -z "$quiet" ] && log_skip $2 ${MAXTEST} "$TEST (clang)";
135 return 0
136 fi
137
138 CLANGPATH=`find_path clang`
139 if [ -n "$CLANGPATH" ]; then
140 CLANG_CC="$CLANGPATH"; export CLANG_CC
141 else
142 [ -z "$quiet" ] && log_skip $2 ${MAXTEST} "$TEST (clang)";
143 return 0
144 fi
145
146 SAVE_TEST="$TEST"
147 TEST="$TEST (clang)"
148 testmake $1 $2
149 retval=$?
150 CLANG_CC=""; export CLANG_CC
151 TEST="$SAVE_TEST"
152 return $retval
153}
154
155testmake ()
156{
157 fail=0
158 #
159 # Compiler warnings can be OS specific, but at least
160 # on Linux there should be none
161 #
162 isLinux=0
163 uname -a | grep Linux >/dev/null
164 if [ $? -eq 0 ]; then
165 isLinux=1
166 sed --in-place 's/-Wall/-Wall -Werror -Wpointer-arith -Wcast-qual/' Makefile
167 fi
168 #
169 if test x$1 = x0; then
170 [ -z "$verbose" ] || log_msg_ok "configure... $TEST";
171 $MAKE clean > /dev/null 2>> test_log
172 if [ -z "$CLANG_CC" ]; then
173 $MAKE cutest > /dev/null 2>> test_log
174 else
175 sed --in-place 's/-Wno-empty-body/-Wno-empty-body -Wno-invalid-source-encoding/g' Makefile
176 sed --in-place 's/-fno-strength-reduce//g' Makefile
177 $MAKE -e CC=$CLANG_CC -e BUILD_CC=$CLANG_CC cutest > /dev/null 2>> test_log
178 fi
179 if test x$? = x0; then
180 [ -z "$verbose" ] || log_msg_ok "make cutest... $TEST";
181 else
182 [ -z "$quiet" ] && log_msg_fail "make cutest... $TEST";
183 fail=1
184 fi
185 else
186 [ -z "$quiet" ] && log_msg_fail "configure... $TEST";
187 if [ x"$3" = xskip ]; then
188 [ -z "$quiet" ] && log_skip $2 ${MAXTEST} "$TEST";
189 fi
190 fail=1
191 fi
192 if [ $isLinux -eq 1 ]; then
193 sed --in-place 's/-Wall -Werror/-Wall/' Makefile
194 fi
195 if [ $fail -eq 1 ]; then
196 [ -z "$quiet" ] && log_fail $2 ${MAXTEST} "$TEST";
197 return 1
198 fi
199 [ -z "$quiet" ] && log_ok $2 ${MAXTEST} "$TEST";
200 return 0
201}
202
203testcompile ()
204{
205 log_start "COMPILE"
206
207 num=0
208 numfail=0
209
210
211 C_LOGFILE=""
212
213 ls /lib/libpcre* >/dev/null 2>&1
214 if [ $? -eq 0 ]; then
215 C_LOGFILE=" --enable-logfile-monitor "
216 else
217 ls /usr/lib/libpcre* >/dev/null 2>&1
218 if [ $? -eq 0 ]; then
219 C_LOGFILE=" --enable-logfile-monitor "
220 else
221 ls /usr/lib/*/libpcre* >/dev/null 2>&1
222 if [ $? -eq 0 ]; then
223 C_LOGFILE=" --enable-logfile-monitor "
224 else
225 ls /usr/local/lib/libpcre* >/dev/null 2>&1
226 if [ $? -eq 0 ]; then
227 C_LOGFILE=" --enable-logfile-monitor "
228 fi
229 fi
230 fi
231 fi
232 if [ x"${C_LOGFILE}" = x ]; then
233 log_msg_ok "Not testing --enable-logfile-monitor";
234 fi
235
236 #
237 # test dnmalloc
238 #
239 TEST="${S}check dnmalloc${E}"
240 #
241 ${TOP_SRCDIR}/configure --quiet > /dev/null 2>> test_log
242 #
243 let "num = num + 1" >/dev/null
244 #
245 run_dnmalloc 0 $num || let "numfail = numfail + 1" >/dev/null
246 #
247
248 #
249 # test dnmalloc
250 #
251 TEST="${S}check w/cppcheck${E}"
252 #
253 let "num = num + 1" >/dev/null
254 #
255 run_cppcheck 0 $num || let "numfail = numfail + 1" >/dev/null
256 #
257
258 #
259 # test flawfinder
260 #
261 TEST="${S}check w/flawfinder${E}"
262 #
263 #
264 let "num = num + 1" >/dev/null
265 FLAWFINDER=`find_path flawfinder`
266 #
267 if [ -z "$FLAWFINDER" ]; then
268 log_skip $num $MAXTEST 'check w/flawfinder (not in PATH)'
269 else
270 run_flawfinder 0 $num || let "numfail = numfail + 1" >/dev/null
271 fi
272 #
273
274 #
275 # test standalone compilation
276 #
277 TEST="${S}standalone w/suidcheck w/procchk${E}"
278 #
279 if test -r "Makefile"; then
280 $MAKE distclean
281 fi
282 #
283 ${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
284 #
285 let "num = num + 1" >/dev/null
286 testmake $? $num || let "numfail = numfail + 1" >/dev/null
287 let "num = num + 1" >/dev/null
288 run_clang $? $num || let "numfail = numfail + 1" >/dev/null
289
290 #
291 # test standalone compilation
292 #
293 TEST="${S}standalone static w/suidcheck w/procchk${E}"
294 #
295 if test -r "Makefile"; then
296 $MAKE distclean
297 fi
298 #
299 ${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
300 #
301 let "num = num + 1" >/dev/null
302 testmake $? $num || let "numfail = numfail + 1" >/dev/null
303 let "num = num + 1" >/dev/null
304 run_clang $? $num || let "numfail = numfail + 1" >/dev/null
305 #
306 # test standalone compilation
307 #
308 TEST="${S}standalone w/procchk w/portchk${E}"
309 #
310 if test -r "Makefile"; then
311 $MAKE distclean
312 fi
313 #
314 ${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
315 #
316 let "num = num + 1" >/dev/null
317 testmake $? $num || let "numfail = numfail + 1" >/dev/null
318 let "num = num + 1" >/dev/null
319 run_clang $? $num || let "numfail = numfail + 1" >/dev/null
320
321 #
322 # test standalone compilation
323 #
324 TEST="${S}standalone w/procchk w/portchk w/static${E}"
325 #
326 if test -r "Makefile"; then
327 $MAKE distclean
328 fi
329 #
330 ${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
331 #
332 let "num = num + 1" >/dev/null
333 testmake $? $num || let "numfail = numfail + 1" >/dev/null
334 let "num = num + 1" >/dev/null
335 run_clang $? $num || let "numfail = numfail + 1" >/dev/null
336 #
337 # test standalone compilation
338 #
339 TEST="${S}standalone w/procchk w/portchk w/stealth${E}"
340 #
341 if test -r "Makefile"; then
342 $MAKE distclean
343 fi
344 #
345 ${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
346 #
347 let "num = num + 1" >/dev/null
348 testmake $? $num || let "numfail = numfail + 1" >/dev/null
349 let "num = num + 1" >/dev/null
350 run_clang $? $num || let "numfail = numfail + 1" >/dev/null
351
352 #
353 # test standalone compilation
354 #
355 TEST="${S}standalone w/mounts-check w/userfiles${E}"
356 #
357 if test -r "Makefile"; then
358 $MAKE distclean
359 fi
360 #
361 ${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
362 #
363 let "num = num + 1" >/dev/null
364 testmake $? $num || let "numfail = numfail + 1" >/dev/null
365 let "num = num + 1" >/dev/null
366 run_clang $? $num || let "numfail = numfail + 1" >/dev/null
367
368
369 #
370 # test standalone compilation
371 #
372 TEST="${S}standalone w/timeserver and w/msgqueue${E}"
373 #
374 if test -r "Makefile"; then
375 $MAKE clean
376 fi
377 #
378 ${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
379 #
380 let "num = num + 1" >/dev/null
381 testmake $? $num || let "numfail = numfail + 1" >/dev/null
382 let "num = num + 1" >/dev/null
383 run_clang $? $num || let "numfail = numfail + 1" >/dev/null
384
385 #
386 # test standalone compilation with --with-nocl=PW
387 #
388 TEST="${S}standalone w/nocl w/logmon${E}"
389 #
390 if test -r "Makefile"; then
391 $MAKE clean
392 fi
393 #
394 ${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
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_clang $? $num || let "numfail = numfail + 1" >/dev/null
400
401 #
402 # test standalone compilation w/ debug
403 #
404 TEST="${S}standalone w/debug${E}"
405 #
406 if test -r "Makefile"; then
407 $MAKE clean
408 fi
409 #
410 ${TOP_SRCDIR}/configure --quiet --enable-debug --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
411 #
412 let "num = num + 1" >/dev/null
413 testmake $? $num || let "numfail = numfail + 1" >/dev/null
414 let "num = num + 1" >/dev/null
415 run_clang $? $num debug || let "numfail = numfail + 1" >/dev/null
416
417 #
418 # test standalone compilation w/ gpg
419 #
420 TEST="${S}standalone w/gpg${E}"
421 #
422 GPG=`find_path gpg`
423 let "num = num + 1" >/dev/null
424 #
425 if [ -z "$GPG" ]; then
426 log_skip $num $MAXTEST 'gpg not in PATH'
427 let "num = num + 1" >/dev/null
428 log_skip $num $MAXTEST 'gpg not in PATH'
429 else
430 if test -r "Makefile"; then
431 $MAKE clean
432 fi
433 #
434 ${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
435 #
436 testmake $? $num || let "numfail = numfail + 1" >/dev/null
437 let "num = num + 1" >/dev/null
438 run_clang $? $num || let "numfail = numfail + 1" >/dev/null
439 fi
440
441 #
442 # test standalone compilation w/stealth
443 #
444 TEST="${S}standalone w/stealth${E}"
445 #
446 if test -r "Makefile"; then
447 $MAKE clean
448 fi
449 #
450 ${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
451 #
452 let "num = num + 1" >/dev/null
453 testmake $? $num || let "numfail = numfail + 1" >/dev/null
454 let "num = num + 1" >/dev/null
455 run_clang $? $num || let "numfail = numfail + 1" >/dev/null
456
457 #
458 # test standalone compilation w/loginwatch
459 #
460 TEST="${S}standalone w/login-watch${E}"
461 #
462 if test -r "Makefile"; then
463 $MAKE clean
464 fi
465 #
466 ${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
467 #
468 let "num = num + 1" >/dev/null
469 testmake $? $num || let "numfail = numfail + 1" >/dev/null
470 let "num = num + 1" >/dev/null
471 run_clang $? $num || let "numfail = numfail + 1" >/dev/null
472
473 #
474 # test standalone compilation w/mysql
475 #
476 TEST="${S}standalone w/mysql${E}"
477 #
478 if test -r "Makefile"; then
479 $MAKE clean
480 fi
481 #
482 ${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
483 #
484 let "num = num + 1" >/dev/null
485 testmake $? $num "skip" || let "numfail = numfail + 1" >/dev/null
486 let "num = num + 1" >/dev/null
487 run_clang $? $num || let "numfail = numfail + 1" >/dev/null
488
489 #
490 # test standalone compilation w/mysql and stealth
491 #
492 TEST="${S}standalone w/mysql+stealth${E}"
493 #
494 if test -r "Makefile"; then
495 $MAKE clean
496 fi
497 #
498 ${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
499 #
500 let "num = num + 1" >/dev/null
501 testmake $? $num "skip" || let "numfail = numfail + 1" >/dev/null
502 let "num = num + 1" >/dev/null
503 run_clang $? $num || let "numfail = numfail + 1" >/dev/null
504
505 #
506 # test standalone compilation w/postgresql
507 #
508 TEST="${S}standalone w/postgresql${E}"
509 #
510 if test -r "Makefile"; then
511 $MAKE clean
512 fi
513 #
514 ${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
515 #
516 let "num = num + 1" >/dev/null
517 testmake $? $num "skip" || let "numfail = numfail + 1" >/dev/null
518 let "num = num + 1" >/dev/null
519 run_clang $? $num || let "numfail = numfail + 1" >/dev/null
520
521 #
522 # test standalone compilation w/postgresql+stealth
523 #
524 TEST="${S}standalone w/postgresql+stealth${E}"
525 #
526 if test -r "Makefile"; then
527 $MAKE clean
528 fi
529 #
530 ${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
531 #
532 let "num = num + 1" >/dev/null
533 testmake $? $num "skip" || let "numfail = numfail + 1" >/dev/null
534 let "num = num + 1" >/dev/null
535 run_clang $? $num || let "numfail = numfail + 1" >/dev/null
536
537 #
538 # test standalone compilation
539 #
540 TEST="${S}standalone w/o mail w/unix_rnd${E}"
541 #
542 if test -r "Makefile"; then
543 $MAKE clean
544 fi
545 #
546 ${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
547 #
548 let "num = num + 1" >/dev/null
549 testmake $? $num || let "numfail = numfail + 1" >/dev/null
550 let "num = num + 1" >/dev/null
551 run_clang $? $num || let "numfail = numfail + 1" >/dev/null
552
553 #
554 # test standalone compilation
555 #
556 TEST="${S}standalone w/o external${E}"
557 #
558 if test -r "Makefile"; then
559 $MAKE clean
560 fi
561 #
562 ${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
563 #
564 let "num = num + 1" >/dev/null
565 testmake $? $num || let "numfail = numfail + 1" >/dev/null
566 let "num = num + 1" >/dev/null
567 run_clang $? $num || let "numfail = numfail + 1" >/dev/null
568
569 # echo; echo "${S}__ TEST CLIENT/SERVER __${E}"; echo;
570
571 #
572 # test client/server compilation
573 #
574 TEST="${S}client/server application w/timeserver${E}"
575 #
576 if test -r "Makefile"; then
577 $MAKE clean
578 fi
579 #
580 ${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
581 #
582 let "num = num + 1" >/dev/null
583 testmake $? $num || let "numfail = numfail + 1" >/dev/null
584 let "num = num + 1" >/dev/null
585 run_clang $? $num || let "numfail = numfail + 1" >/dev/null
586
587 if test -r "Makefile"; then
588 $MAKE clean
589 fi
590 #
591 ${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
592 #
593 let "num = num + 1" >/dev/null
594 testmake $? $num || let "numfail = numfail + 1" >/dev/null
595 let "num = num + 1" >/dev/null
596 run_clang $? $num || let "numfail = numfail + 1" >/dev/null
597
598 #
599 # test client/server compilation w/prelude
600 #
601 TEST="${S}client/server application w/prelude${E}"
602 #
603 if [ -z "$doall" ]; then
604 let "num = num + 1" >/dev/null
605 [ -z "$quiet" ] && log_skip $num ${MAXTEST} "$TEST";
606 let "num = num + 1" >/dev/null
607 [ -z "$quiet" ] && log_skip $num ${MAXTEST} "$TEST (smatch)";
608
609 let "num = num + 1" >/dev/null
610 [ -z "$quiet" ] && log_skip $num ${MAXTEST} "$TEST";
611 let "num = num + 1" >/dev/null
612 [ -z "$quiet" ] && log_skip $num ${MAXTEST} "$TEST (smatch)";
613 else
614 if test -r "Makefile"; then
615 $MAKE clean
616 fi
617 #
618 ${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
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_clang $? $num || let "numfail = numfail + 1" >/dev/null
624
625 if test -r "Makefile"; then
626 $MAKE clean
627 fi
628 #
629 ${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
630 #
631 let "num = num + 1" >/dev/null
632 testmake $? $num || let "numfail = numfail + 1" >/dev/null
633 let "num = num + 1" >/dev/null
634 run_clang $? $num || let "numfail = numfail + 1" >/dev/null
635 #
636 fi
637
638 #
639 # test client/server compilation
640 #
641 TEST="${S}client/server application static w/timeserver${E}"
642 #
643 if test -r "Makefile"; then
644 $MAKE clean
645 fi
646 #
647 ${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
648 #
649 let "num = num + 1" >/dev/null
650 testmake $? $num || let "numfail = numfail + 1" >/dev/null
651 let "num = num + 1" >/dev/null
652 run_clang $? $num || let "numfail = numfail + 1" >/dev/null
653
654 if test -r "Makefile"; then
655 $MAKE clean
656 fi
657 #
658 ${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
659 #
660 let "num = num + 1" >/dev/null
661 testmake $? $num || let "numfail = numfail + 1" >/dev/null
662 let "num = num + 1" >/dev/null
663 run_clang $? $num || let "numfail = numfail + 1" >/dev/null
664 #
665 # test c/s compilation w/ gpg
666 #
667 TEST="${S}client/server application w/gpg${E}"
668 #
669 GPG=`find_path gpg`
670 let "num = num + 1" >/dev/null
671 #
672 if [ -z "$GPG" ]; then
673 log_skip $num $MAXTEST 'gpg not in PATH'
674 let "num = num + 1" >/dev/null
675 log_skip $num $MAXTEST 'gpg not in PATH'
676 let "num = num + 1" >/dev/null
677 log_skip $num $MAXTEST 'gpg not in PATH'
678 let "num = num + 1" >/dev/null
679 log_skip $num $MAXTEST 'gpg not in PATH'
680 else
681 if test -r "Makefile"; then
682 $MAKE clean
683 fi
684 #
685 ${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
686 #
687 testmake $? $num || let "numfail = numfail + 1" >/dev/null
688 let "num = num + 1" >/dev/null
689 run_clang $? $num || let "numfail = numfail + 1" >/dev/null
690 #
691 if test -r "Makefile"; then
692 $MAKE clean
693 fi
694 #
695 ${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
696 #
697 let "num = num + 1" >/dev/null
698 testmake $? $num || let "numfail = numfail + 1" >/dev/null
699 let "num = num + 1" >/dev/null
700 run_clang $? $num || let "numfail = numfail + 1" >/dev/null
701 fi
702
703
704 #
705 # test client/server compilation
706 #
707 TEST="${S}client/server application w/o srp, w/udp${E}"
708 #
709 if test -r "Makefile"; then
710 $MAKE clean
711 fi
712 #
713 ${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
714 #
715 let "num = num + 1" >/dev/null
716 testmake $? $num || let "numfail = numfail + 1" >/dev/null
717 let "num = num + 1" >/dev/null
718 run_clang $? $num || let "numfail = numfail + 1" >/dev/null
719 #
720 if test -r "Makefile"; then
721 $MAKE clean
722 fi
723 #
724 ${TOP_SRCDIR}/configure --quiet --enable-network=client --disable-srp --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
725 #
726 let "num = num + 1" >/dev/null
727 testmake $? $num || let "numfail = numfail + 1" >/dev/null
728 let "num = num + 1" >/dev/null
729 run_clang $? $num || let "numfail = numfail + 1" >/dev/null
730
731 #
732 # test client/server compilation w/ debug
733 #
734 TEST="${S}client/server application w/debug${E}"
735 #
736 if test -r "Makefile"; then
737 $MAKE clean
738 fi
739 #
740 ${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
741 #
742 let "num = num + 1" >/dev/null
743 testmake $? $num || let "numfail = numfail + 1" >/dev/null
744 let "num = num + 1" >/dev/null
745 run_clang $? $num debug || let "numfail = numfail + 1" >/dev/null
746 #
747 if test -r "Makefile"; then
748 $MAKE clean
749 fi
750 #
751 ${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
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_clang $? $num debug || let "numfail = numfail + 1" >/dev/null
757
758 #
759 # test client/server compilation w/stealth
760 #
761 TEST="${S}client/server application w/stealth${E}"
762 #
763 if test -r "Makefile"; then
764 $MAKE clean
765 fi
766 #
767 ${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
768 #
769 let "num = num + 1" >/dev/null
770 testmake $? $num || let "numfail = numfail + 1" >/dev/null
771 let "num = num + 1" >/dev/null
772 run_clang $? $num || let "numfail = numfail + 1" >/dev/null
773 #
774 if test -r "Makefile"; then
775 $MAKE clean
776 fi
777 #
778 ${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
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_clang $? $num || let "numfail = numfail + 1" >/dev/null
784
785 #
786 # test client/server compilation w/logwatch
787 #
788 TEST="${S}client/server application w/login-watch,udp,no_ipv6${E}"
789 #
790 if test -r "Makefile"; then
791 $MAKE clean
792 fi
793 #
794 ${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
795 #
796 let "num = num + 1" >/dev/null
797 testmake $? $num || let "numfail = numfail + 1" >/dev/null
798 let "num = num + 1" >/dev/null
799 run_clang $? $num || let "numfail = numfail + 1" >/dev/null
800 #
801 if test -r "Makefile"; then
802 $MAKE clean
803 fi
804 #
805 ${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
806 #
807 let "num = num + 1" >/dev/null
808 testmake $? $num || let "numfail = numfail + 1" >/dev/null
809 let "num = num + 1" >/dev/null
810 run_clang $? $num || let "numfail = numfail + 1" >/dev/null
811
812 #
813 # test client/server compilation
814 #
815 TEST="${S}client/server application w/o mail${E}"
816 #
817 if test -r "Makefile"; then
818 $MAKE clean
819 fi
820 #
821 ${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
822 #
823 let "num = num + 1" >/dev/null
824 testmake $? $num || let "numfail = numfail + 1" >/dev/null
825 let "num = num + 1" >/dev/null
826 run_clang $? $num debug || let "numfail = numfail + 1" >/dev/null
827 #
828 if test -r "Makefile"; then
829 $MAKE clean
830 fi
831 #
832 ${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
833 #
834 let "num = num + 1" >/dev/null
835 testmake $? $num || let "numfail = numfail + 1" >/dev/null
836 let "num = num + 1" >/dev/null
837 run_clang $? $num debug || let "numfail = numfail + 1" >/dev/null
838
839 #
840 # test client/server compilation
841 #
842 TEST="${S}client/server application w/o external${E}"
843 #
844 if test -r "Makefile"; then
845 $MAKE clean
846 fi
847 #
848 ${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
849 #
850 let "num = num + 1" >/dev/null
851 testmake $? $num || let "numfail = numfail + 1" >/dev/null
852 let "num = num + 1" >/dev/null
853 run_clang $? $num || let "numfail = numfail + 1" >/dev/null
854 #
855 if test -r "Makefile"; then
856 $MAKE clean
857 fi
858 #
859 ${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
860 #
861 let "num = num + 1" >/dev/null
862 testmake $? $num || let "numfail = numfail + 1" >/dev/null
863 let "num = num + 1" >/dev/null
864 run_clang $? $num || let "numfail = numfail + 1" >/dev/null
865
866 log_end "COMPILE"
867}
Note: See TracBrowser for help on using the repository browser.