Changeset 22 for trunk/test/testcompile.sh
- Timestamp:
- Feb 23, 2006, 12:03:58 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/testcompile.sh
r19 r22 1 1 #! /bin/sh 2 2 3 MAXTEST=28; export MAXTEST 3 MAXTEST=56; export MAXTEST 4 5 run_smatch () 6 { 7 export CDIR=`pwd`; 8 9 if [ -z "$doall" ]; then 10 [ -z "$quiet" ] && log_skip $2 ${MAXTEST} "$TEST (smatch)"; 11 return 0 12 fi 13 14 if [ "x$3" = "xdebug" ]; then memcheck=debug; else memcheck=simple; fi 15 if [ -f ../sm_scripts/smatch.pm ]; then 16 ( 17 cd ../sm_scripts; 18 19 for i in ${CDIR}/*.c.sm ; do 20 # echo $i; 21 cat $i | ./unreached_code.pl; 22 cat $i | ./ampersand_missing.sh; 23 cat $i | ./uninitialized.pl; 24 cat $i | ./eqeq.pl; 25 cat $i | ./for_bounds.pl; 26 cat $i | ./unchecked_returns.pl; 27 cat $i | ./unreached_code.pl; 28 cat $i | ./uninitialized.pl; 29 # from http://people.redhat.com/mstefani/wine/smatch/ 30 if [ -f ./while_for_check.pl ]; then 31 cat $i | ./while_for_check.pl; 32 fi 33 # --> end wine <-- 34 # samhain specific 35 if [ $memcheck = xsimple ]; then 36 if [ -f ./samhain_unfree.pl ]; then 37 cat $i | ./samhain_unfree.pl | \ 38 egrep -v 'x_cutest_.*Test_' | \ 39 egrep -v 'x_sh_unix.c .... .... sh_unix_copyenv'; 40 fi 41 fi 42 if [ $memcheck = xdebug ]; then 43 if [ -f ./samhain_unfree_debug.pl ]; then 44 cat $i | ./samhain_unfree_debug.pl | \ 45 egrep -v 'x_cutest_.*Test_' | \ 46 egrep -v 'x_sh_unix.c .... .... sh_unix_copyenv'; 47 fi 48 fi 49 # --> end samhain specific <-- 50 #cat $i | ./unfree.pl | \ 51 # egrep -v 'x_cutest_.*Test_' | \ 52 # grep -v 'x_sh_unix.c .... .... sh_unix_copyenv'; 53 touch list_null_funcs_uniq; 54 cat $i | ./deference_check.pl; 55 rm -f list_null_funcs_uniq; 56 rm -f $i 57 done 58 ) >test_log_smatch 2>&1 59 if [ -f test_log_smatch ]; then 60 lines=`cat test_log_smatch | wc -l` 61 if [ $lines -ne 0 ]; then 62 cat test_log_smatch 63 rm -f test_log_smatch 64 [ -z "$quiet" ] && log_fail $2 ${MAXTEST} "$TEST (smatch)"; 65 return 1 66 fi 67 fi 68 [ -z "$quiet" ] && log_ok $2 ${MAXTEST} "$TEST (smatch)"; 69 return 0 70 fi 71 [ -z "$quiet" ] && log_skip $2 ${MAXTEST} "$TEST (smatch)"; 72 return 0 73 } 4 74 5 75 testmake () … … 8 78 if test x$1 = x0; then 9 79 [ -z "$verbose" ] || log_msg_ok "configure... $TEST"; 10 $MAKE cutest > /dev/null 2>> test_log80 $MAKE ${SMATCH} cutest > /dev/null 2>> test_log 11 81 if test x$? = x0; then 12 82 [ -z "$verbose" ] || log_msg_ok "make cutest... $TEST"; … … 34 104 log_start "COMPILE" 35 105 106 if [ -f /usr/local/gcc-smatch/bin/gcc ]; then 107 SAVE_CC="${CC}" 108 SMATCH="DBGDEF=--smatch"; export SMATCH 109 CC="/usr/local/gcc-smatch/bin/gcc"; export CC 110 fi 111 36 112 num=0 37 113 numfail=0 … … 40 116 # test standalone compilation 41 117 # 42 TEST="${S}standalone agentw/suidcheck${E}"118 TEST="${S}standalone w/suidcheck${E}" 43 119 # 44 120 if test -r "Makefile"; then … … 50 126 let "num = num + 1" >/dev/null 51 127 testmake $? $num || let "numfail = numfail + 1" >/dev/null 128 let "num = num + 1" >/dev/null 129 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 52 130 53 131 # 54 132 # test standalone compilation 55 133 # 56 TEST="${S}standalone agent w/mounts-check andw/userfiles${E}"134 TEST="${S}standalone w/mounts-check w/userfiles${E}" 57 135 # 58 136 if test -r "Makefile"; then … … 64 142 let "num = num + 1" >/dev/null 65 143 testmake $? $num || let "numfail = numfail + 1" >/dev/null 144 let "num = num + 1" >/dev/null 145 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 66 146 67 147 … … 69 149 # test standalone compilation 70 150 # 71 TEST="${S}standalone agent w/timeserver and w/message-queue${E}"151 TEST="${S}standalone w/timeserver and w/msgqueue${E}" 72 152 # 73 153 if test -r "Makefile"; then … … 79 159 let "num = num + 1" >/dev/null 80 160 testmake $? $num || let "numfail = numfail + 1" >/dev/null 161 let "num = num + 1" >/dev/null 162 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 81 163 82 164 # 83 165 # test standalone compilation with --with-nocl=PW 84 166 # 85 TEST="${S}standalone agentw/nocl${E}"167 TEST="${S}standalone w/nocl${E}" 86 168 # 87 169 if test -r "Makefile"; then … … 93 175 let "num = num + 1" >/dev/null 94 176 testmake $? $num || let "numfail = numfail + 1" >/dev/null 177 let "num = num + 1" >/dev/null 178 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 95 179 96 180 # 97 181 # test standalone compilation w/ debug 98 182 # 99 TEST="${S}standalone agentw/debug${E}"183 TEST="${S}standalone w/debug${E}" 100 184 # 101 185 if test -r "Makefile"; then … … 107 191 let "num = num + 1" >/dev/null 108 192 testmake $? $num || let "numfail = numfail + 1" >/dev/null 193 let "num = num + 1" >/dev/null 194 run_smatch $? $num debug || let "numfail = numfail + 1" >/dev/null 109 195 110 196 # 111 197 # test standalone compilation w/ gpg 112 198 # 113 TEST="${S}standalone agentw/gpg${E}"199 TEST="${S}standalone w/gpg${E}" 114 200 # 115 201 GPG=`find_path gpg` … … 126 212 # 127 213 testmake $? $num || let "numfail = numfail + 1" >/dev/null 214 let "num = num + 1" >/dev/null 215 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 128 216 fi 129 217 … … 131 219 # test standalone compilation w/stealth 132 220 # 133 TEST="${S}standalone agentw/stealth${E}"221 TEST="${S}standalone w/stealth${E}" 134 222 # 135 223 if test -r "Makefile"; then … … 141 229 let "num = num + 1" >/dev/null 142 230 testmake $? $num || let "numfail = numfail + 1" >/dev/null 231 let "num = num + 1" >/dev/null 232 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 143 233 144 234 # 145 235 # test standalone compilation w/logwatch 146 236 # 147 TEST="${S}standalone agentw/login-watch${E}"237 TEST="${S}standalone w/login-watch${E}" 148 238 # 149 239 if test -r "Makefile"; then … … 155 245 let "num = num + 1" >/dev/null 156 246 testmake $? $num || let "numfail = numfail + 1" >/dev/null 247 let "num = num + 1" >/dev/null 248 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 157 249 158 250 # 159 251 # test standalone compilation w/mysql 160 252 # 161 TEST="${S}standalone agentw/mysql${E}"253 TEST="${S}standalone w/mysql${E}" 162 254 # 163 255 if test -r "Makefile"; then … … 169 261 let "num = num + 1" >/dev/null 170 262 testmake $? $num "skip" || let "numfail = numfail + 1" >/dev/null 263 let "num = num + 1" >/dev/null 264 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 171 265 172 266 # 173 267 # test standalone compilation w/postgresql 174 268 # 175 TEST="${S}standalone agentw/postgresql${E}"269 TEST="${S}standalone w/postgresql${E}" 176 270 # 177 271 if test -r "Makefile"; then … … 183 277 let "num = num + 1" >/dev/null 184 278 testmake $? $num "skip" || let "numfail = numfail + 1" >/dev/null 279 let "num = num + 1" >/dev/null 280 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 185 281 186 282 # 187 283 # test standalone compilation 188 284 # 189 TEST="${S}standalone agentw/o mail${E}"285 TEST="${S}standalone w/o mail${E}" 190 286 # 191 287 if test -r "Makefile"; then … … 197 293 let "num = num + 1" >/dev/null 198 294 testmake $? $num || let "numfail = numfail + 1" >/dev/null 295 let "num = num + 1" >/dev/null 296 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 199 297 200 298 # 201 299 # test standalone compilation 202 300 # 203 TEST="${S}standalone agent w/o external scripts${E}"301 TEST="${S}standalone w/o external${E}" 204 302 # 205 303 if test -r "Makefile"; then … … 211 309 let "num = num + 1" >/dev/null 212 310 testmake $? $num || let "numfail = numfail + 1" >/dev/null 311 let "num = num + 1" >/dev/null 312 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 213 313 214 314 # echo; echo "${S}__ TEST CLIENT/SERVER __${E}"; echo; … … 227 327 let "num = num + 1" >/dev/null 228 328 testmake $? $num || let "numfail = numfail + 1" >/dev/null 329 let "num = num + 1" >/dev/null 330 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 229 331 230 332 if test -r "Makefile"; then … … 236 338 let "num = num + 1" >/dev/null 237 339 testmake $? $num || let "numfail = numfail + 1" >/dev/null 340 let "num = num + 1" >/dev/null 341 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 238 342 239 343 # … … 257 361 # 258 362 testmake $? $num || let "numfail = numfail + 1" >/dev/null 363 let "num = num + 1" >/dev/null 364 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 259 365 # 260 366 if test -r "Makefile"; then … … 266 372 let "num = num + 1" >/dev/null 267 373 testmake $? $num || let "numfail = numfail + 1" >/dev/null 374 let "num = num + 1" >/dev/null 375 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 268 376 fi 269 377 … … 282 390 let "num = num + 1" >/dev/null 283 391 testmake $? $num || let "numfail = numfail + 1" >/dev/null 392 let "num = num + 1" >/dev/null 393 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 284 394 # 285 395 if test -r "Makefile"; then … … 291 401 let "num = num + 1" >/dev/null 292 402 testmake $? $num || let "numfail = numfail + 1" >/dev/null 403 let "num = num + 1" >/dev/null 404 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 293 405 294 406 # … … 305 417 let "num = num + 1" >/dev/null 306 418 testmake $? $num || let "numfail = numfail + 1" >/dev/null 419 let "num = num + 1" >/dev/null 420 run_smatch $? $num debug || let "numfail = numfail + 1" >/dev/null 307 421 # 308 422 if test -r "Makefile"; then … … 314 428 let "num = num + 1" >/dev/null 315 429 testmake $? $num || let "numfail = numfail + 1" >/dev/null 430 let "num = num + 1" >/dev/null 431 run_smatch $? $num debug || let "numfail = numfail + 1" >/dev/null 316 432 317 433 # … … 328 444 let "num = num + 1" >/dev/null 329 445 testmake $? $num || let "numfail = numfail + 1" >/dev/null 446 let "num = num + 1" >/dev/null 447 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 330 448 # 331 449 if test -r "Makefile"; then … … 337 455 let "num = num + 1" >/dev/null 338 456 testmake $? $num || let "numfail = numfail + 1" >/dev/null 457 let "num = num + 1" >/dev/null 458 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 339 459 340 460 # … … 351 471 let "num = num + 1" >/dev/null 352 472 testmake $? $num || let "numfail = numfail + 1" >/dev/null 473 let "num = num + 1" >/dev/null 474 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 353 475 # 354 476 if test -r "Makefile"; then … … 360 482 let "num = num + 1" >/dev/null 361 483 testmake $? $num || let "numfail = numfail + 1" >/dev/null 484 let "num = num + 1" >/dev/null 485 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 362 486 363 487 # … … 374 498 let "num = num + 1" >/dev/null 375 499 testmake $? $num || let "numfail = numfail + 1" >/dev/null 500 let "num = num + 1" >/dev/null 501 run_smatch $? $num debug || let "numfail = numfail + 1" >/dev/null 376 502 # 377 503 if test -r "Makefile"; then … … 383 509 let "num = num + 1" >/dev/null 384 510 testmake $? $num || let "numfail = numfail + 1" >/dev/null 511 let "num = num + 1" >/dev/null 512 run_smatch $? $num debug || let "numfail = numfail + 1" >/dev/null 385 513 386 514 # 387 515 # test client/server compilation 388 516 # 389 TEST="${S}client/server application w/o external scripts${E}"517 TEST="${S}client/server application w/o external${E}" 390 518 # 391 519 if test -r "Makefile"; then … … 397 525 let "num = num + 1" >/dev/null 398 526 testmake $? $num || let "numfail = numfail + 1" >/dev/null 527 let "num = num + 1" >/dev/null 528 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 399 529 # 400 530 if test -r "Makefile"; then … … 406 536 let "num = num + 1" >/dev/null 407 537 testmake $? $num || let "numfail = numfail + 1" >/dev/null 538 let "num = num + 1" >/dev/null 539 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 540 541 [ -z "${SMATCH}" ] || { CC="${SAVE_CC}"; export CC; } 408 542 409 543 log_end "COMPILE"
Note:
See TracChangeset
for help on using the changeset viewer.