source: trunk/test/testcompile.sh@ 583

Last change on this file since 583 was 576, checked in by katerina, 3 years ago

For ticket #464 (changelog, release).

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