Changeset 473 for trunk/test


Ignore:
Timestamp:
May 29, 2015, 10:42:18 PM (10 years ago)
Author:
katerina
Message:

Fix for ticket #371 (use cppcheck instead of uno for static checking).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/testcompile.sh

    r378 r473  
    2020#
    2121
    22 # dnmalloc + flawfinder + (36 * 3)
    23 MAXTEST=116; export MAXTEST
     22# dnmalloc + cppcheck + flawfinder + (38 * 2)
     23MAXTEST=79; export MAXTEST
    2424
    2525run_dnmalloc ()
     
    8383}
    8484
    85 run_uno ()
     85run_cppcheck ()
    8686{
    8787    if [ -z "$doall" ]; then
    88         [ -z "$quiet" ] && log_skip $2 ${MAXTEST} "$TEST (uno)";
     88        [ -z "$quiet" ] && log_skip $2 ${MAXTEST} "check w/cppcheck";
    8989        return 0
    9090    fi
    9191    #
    92     UNO=`find_path uno`
     92    CPC=`find_path cppcheck`
    9393    #
    94     if [ -z "$UNO" ]; then
    95         log_skip $num $MAXTEST 'check w/uno (not in PATH)'
     94    if [ -z "$CPC" ]; then
     95        log_skip $num ${MAXTEST} 'check w/cppcheck (not in PATH)'
    9696        return 0
    9797    fi
    9898    #
    9999    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
     100    stat=`cppcheck --quiet --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`
     101    if [ $stat -ne 0 ]; then
     102        cppcheck --quiet --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
    103103        retval=1
    104         [ -z "$quiet" ] && log_fail $2 ${MAXTEST} "$TEST (uno)";
     104        [ -z "$quiet" ] && log_fail $2 ${MAXTEST} "check w/cppcheck";
    105105    else
    106106        retval=0
    107         [ -z "$quiet" ] &&     log_ok   $2 ${MAXTEST} "$TEST (uno)";
     107        [ -z "$quiet" ] &&     log_ok   $2 ${MAXTEST} "check w/cppcheck";
    108108    fi
    109109    cd ..
     
    303303
    304304        #
     305        # test dnmalloc
     306        #
     307        TEST="${S}check w/cppcheck${E}"
     308        #
     309        let "num = num + 1" >/dev/null
     310        #
     311        run_cppcheck 0 $num || let "numfail = numfail + 1"  >/dev/null
     312        #
     313
     314        #
    305315        # test flawfinder
    306316        #
     
    333343        let "num = num + 1" >/dev/null
    334344        run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
    335         let "num = num + 1" >/dev/null
    336         run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    337345
    338346        #
     
    353361        let "num = num + 1" >/dev/null
    354362        run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
    355         let "num = num + 1" >/dev/null
    356         run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    357363        #
    358364        [ -z "${SMATCH_CC}" ] || { CC="${SMATCH_CC}"; export CC; SMATCH="${SAVE_SMATCH}"; export SMATCH; }
     
    372378        let "num = num + 1" >/dev/null
    373379        run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
    374         let "num = num + 1" >/dev/null
    375         run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    376380
    377381        #
     
    392396        let "num = num + 1" >/dev/null
    393397        run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
    394         let "num = num + 1" >/dev/null
    395         run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    396398        #
    397399        [ -z "${SMATCH_CC}" ] || { CC="${SMATCH_CC}"; export CC; SMATCH="${SAVE_SMATCH}"; export SMATCH; }
     
    411413        let "num = num + 1" >/dev/null
    412414        run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
    413         let "num = num + 1" >/dev/null
    414         run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    415415
    416416        #
     
    429429        let "num = num + 1" >/dev/null
    430430        run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
    431         let "num = num + 1" >/dev/null
    432         run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    433431
    434432
     
    448446        let "num = num + 1" >/dev/null
    449447        run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
    450         let "num = num + 1" >/dev/null
    451         run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    452448
    453449        #
     
    466462        let "num = num + 1" >/dev/null
    467463        run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
    468         let "num = num + 1" >/dev/null
    469         run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    470464
    471465        #
     
    484478        let "num = num + 1" >/dev/null
    485479        run_smatch $? $num debug || let "numfail = numfail + 1"  >/dev/null
    486         let "num = num + 1" >/dev/null
    487         run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    488480
    489481        #
     
    509501            let "num = num + 1" >/dev/null
    510502            run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
    511             let "num = num + 1" >/dev/null
    512             run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    513503        fi
    514504
     
    528518        let "num = num + 1" >/dev/null
    529519        run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
    530         let "num = num + 1" >/dev/null
    531         run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    532520
    533521        #
     
    546534        let "num = num + 1" >/dev/null
    547535        run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
    548         let "num = num + 1" >/dev/null
    549         run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    550536
    551537        #
     
    564550        let "num = num + 1" >/dev/null
    565551        run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
    566         let "num = num + 1" >/dev/null
    567         run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    568552
    569553        #
     
    582566        let "num = num + 1" >/dev/null
    583567        run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
    584         let "num = num + 1" >/dev/null
    585         run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    586568
    587569        #
     
    600582        let "num = num + 1" >/dev/null
    601583        run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
    602         let "num = num + 1" >/dev/null
    603         run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    604584
    605585        #
     
    618598        let "num = num + 1" >/dev/null
    619599        run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
    620         let "num = num + 1" >/dev/null
    621         run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    622600
    623601        #
     
    636614        let "num = num + 1" >/dev/null
    637615        run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
    638         let "num = num + 1" >/dev/null
    639         run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    640616
    641617        #
     
    654630        let "num = num + 1" >/dev/null
    655631        run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
    656         let "num = num + 1" >/dev/null
    657         run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    658632
    659633        # echo; echo "${S}__ TEST CLIENT/SERVER __${E}"; echo;
     
    674648        let "num = num + 1" >/dev/null
    675649        run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
    676         let "num = num + 1" >/dev/null
    677         run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    678650       
    679651        if test -r "Makefile"; then
     
    687659        let "num = num + 1" >/dev/null
    688660        run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
    689         let "num = num + 1" >/dev/null
    690         run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    691661
    692662        #
     
    700670            let "num = num + 1" >/dev/null
    701671            [ -z "$quiet" ] && log_skip $num ${MAXTEST} "$TEST (smatch)";
    702             let "num = num + 1" >/dev/null
    703             [ -z "$quiet" ] && log_skip $num ${MAXTEST} "$TEST (uno)";
    704672
    705673            let "num = num + 1" >/dev/null
     
    707675            let "num = num + 1" >/dev/null
    708676            [ -z "$quiet" ] && log_skip $num ${MAXTEST} "$TEST (smatch)";
    709             let "num = num + 1" >/dev/null
    710             [ -z "$quiet" ] && log_skip $num ${MAXTEST} "$TEST (uno)";
    711677        else
    712678            if test -r "Makefile"; then
     
    720686            let "num = num + 1" >/dev/null
    721687            run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
    722             let "num = num + 1" >/dev/null
    723             run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    724688           
    725689            if test -r "Makefile"; then
     
    733697            let "num = num + 1" >/dev/null
    734698            run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
    735             let "num = num + 1" >/dev/null
    736             run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    737699            #
    738700        fi
     
    755717        let "num = num + 1" >/dev/null
    756718        run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
    757         let "num = num + 1" >/dev/null
    758         run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    759719       
    760720        if test -r "Makefile"; then
     
    768728        let "num = num + 1" >/dev/null
    769729        run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
    770         let "num = num + 1" >/dev/null
    771         run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    772730        #
    773731        [ -z "${SMATCH_CC}" ] || { CC="${SMATCH_CC}"; export CC; SMATCH="${SAVE_SMATCH}"; export SMATCH; }
     
    798756            let "num = num + 1" >/dev/null
    799757            run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
    800             let "num = num + 1" >/dev/null
    801             run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    802758            #
    803759            if test -r "Makefile"; then
     
    811767            let "num = num + 1" >/dev/null
    812768            run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
    813             let "num = num + 1" >/dev/null
    814             run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    815769        fi
    816770
     
    831785        let "num = num + 1" >/dev/null
    832786        run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
    833         let "num = num + 1" >/dev/null
    834         run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    835787        #
    836788        if test -r "Makefile"; then
     
    844796        let "num = num + 1" >/dev/null
    845797        run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
    846         let "num = num + 1" >/dev/null
    847         run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    848798
    849799        #
     
    862812        let "num = num + 1" >/dev/null
    863813        run_smatch $? $num debug || let "numfail = numfail + 1"  >/dev/null
    864         let "num = num + 1" >/dev/null
    865         run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    866814        #
    867815        if test -r "Makefile"; then
     
    875823        let "num = num + 1" >/dev/null
    876824        run_smatch $? $num debug || let "numfail = numfail + 1"  >/dev/null
    877         let "num = num + 1" >/dev/null
    878         run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    879825
    880826        #
     
    893839        let "num = num + 1" >/dev/null
    894840        run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
    895         let "num = num + 1" >/dev/null
    896         run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    897841        #
    898842        if test -r "Makefile"; then
     
    906850        let "num = num + 1" >/dev/null
    907851        run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
    908         let "num = num + 1" >/dev/null
    909         run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    910852
    911853        #
     
    924866        let "num = num + 1" >/dev/null
    925867        run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
    926         let "num = num + 1" >/dev/null
    927         run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    928868        #
    929869        if test -r "Makefile"; then
     
    937877        let "num = num + 1" >/dev/null
    938878        run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
    939         let "num = num + 1" >/dev/null
    940         run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    941879
    942880        #
     
    955893        let "num = num + 1" >/dev/null
    956894        run_smatch $? $num debug || let "numfail = numfail + 1"  >/dev/null
    957         let "num = num + 1" >/dev/null
    958         run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    959895        #
    960896        if test -r "Makefile"; then
     
    968904        let "num = num + 1" >/dev/null
    969905        run_smatch $? $num debug || let "numfail = numfail + 1"  >/dev/null
    970         let "num = num + 1" >/dev/null
    971         run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    972906
    973907        #
     
    986920        let "num = num + 1" >/dev/null
    987921        run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
    988         let "num = num + 1" >/dev/null
    989         run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    990922        #
    991923        if test -r "Makefile"; then
     
    999931        let "num = num + 1" >/dev/null
    1000932        run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
    1001         let "num = num + 1" >/dev/null
    1002         run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    1003933
    1004934        [ -z "${SMATCH}" ] || { CC="${SAVE_CC}"; export CC; }
Note: See TracChangeset for help on using the changeset viewer.