Changeset 171 for trunk/test


Ignore:
Timestamp:
Jul 8, 2008, 11:16:14 AM (16 years ago)
Author:
katerina
Message:

Include dnmalloc (ticket #108) and fix bugs #106 (EINPROGRESS) and #107 (compressBound).

Location:
trunk/test
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/test.sh

    r170 r171  
    363363        len=`echo "$msg" | awk '/1;30m/ { print length()-10; }; !/1;30m/ { print length();}'`
    364364        let "cols = cols - len" >/dev/null
    365         moveto='['$cols'C'
    366         echo "${msg}${moveto}${ccode}[${3}]${E}"
     365        if [ $cols -ge 0 ]; then
     366            moveto='['$cols'C'
     367            echo "${msg}${moveto}${ccode}[${3}]${E}"
     368        else
     369            echo "${msg}${ccode}[${3}]${E}"
     370        fi
    367371    fi
    368372}
     
    440444    rm -f yule.html
    441445    rm -f yule.html2
     446    rm -f test_dnmalloc
    442447}
    443448
  • trunk/test/testcompile.sh

    r170 r171  
    2020#
    2121
    22 MAXTEST=71; export MAXTEST
     22# dnmalloc + flawfinder + (35 * 3)
     23MAXTEST=107; 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 -DUSE_UNO=1 -t -I. -I.. -I../include sh_*.c samhain.c slib.c dnmalloc-portable.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 -DUSE_UNO=1 -t -I. -I.. -I../include sh_*.c samhain.c slib.c dnmalloc-portable.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}
    23112
    24113run_flawfinder ()
     
    45134
    46135    if [ ! -f "./x_samhain.c.sm" ]; then
    47         [ -z "$quiet" ] && log_skip $2 ${MAXTEST} "$TEST (skip smatch)";
     136        [ -z "$quiet" ] && log_skip $2 ${MAXTEST} "$TEST (skip sm)";
    48137        return 0
    49138    fi
     
    142231        log_start "COMPILE"
    143232
    144         if [ -f /usr/local/gcc-smatch/bin/gcc ]; then
    145             SAVE_CC="${CC}"
    146             SMATCH="DBGDEF=--smatch"; export SMATCH
    147             SAVE_SMATCH="${SMATCH}"; export SAVE_SMATCH
    148             CC="/usr/local/gcc-smatch/bin/gcc"; export CC
    149             SMATCH_CC="${CC}"
     233        if [ "x$doall" = xon ]; then
     234            if [ -f /usr/local/gcc-smatch/bin/gcc ]; then  # FIXME
     235                SAVE_CC="${CC}"
     236                SMATCH="DBGDEF=--smatch"; export SMATCH
     237                SAVE_SMATCH="${SMATCH}"; export SAVE_SMATCH
     238                CC="/usr/local/gcc-smatch/bin/gcc"; export CC
     239                SMATCH_CC="${CC}"
     240            fi
    150241        fi
    151242
    152243        num=0
    153244        numfail=0
     245
     246        #
     247        # test dnmalloc
     248        #
     249        TEST="${S}check dnmalloc${E}"
     250        #
     251        ${TOP_SRCDIR}/configure --quiet > /dev/null 2>> test_log
     252        #
     253        let "num = num + 1" >/dev/null
     254        #
     255        run_dnmalloc 0 $num || let "numfail = numfail + 1"  >/dev/null
     256        #
    154257
    155258        #
     
    184287        let "num = num + 1" >/dev/null
    185288        run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
     289        let "num = num + 1" >/dev/null
     290        run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    186291
    187292        #
     
    202307        let "num = num + 1" >/dev/null
    203308        run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
     309        let "num = num + 1" >/dev/null
     310        run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    204311        #
    205312        [ -z "${SMATCH_CC}" ] || { CC="${SMATCH_CC}"; export CC; SMATCH="${SAVE_SMATCH}"; export SMATCH; }
     
    219326        let "num = num + 1" >/dev/null
    220327        run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
     328        let "num = num + 1" >/dev/null
     329        run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    221330
    222331        #
     
    235344        let "num = num + 1" >/dev/null
    236345        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
    237348
    238349        #
     
    251362        let "num = num + 1" >/dev/null
    252363        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
    253366
    254367
     
    268381        let "num = num + 1" >/dev/null
    269382        run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
     383        let "num = num + 1" >/dev/null
     384        run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    270385
    271386        #
     
    284399        let "num = num + 1" >/dev/null
    285400        run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
     401        let "num = num + 1" >/dev/null
     402        run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    286403
    287404        #
     
    300417        let "num = num + 1" >/dev/null
    301418        run_smatch $? $num debug || let "numfail = numfail + 1"  >/dev/null
     419        let "num = num + 1" >/dev/null
     420        run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    302421
    303422        #
     
    323442            let "num = num + 1" >/dev/null
    324443            run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
     444            let "num = num + 1" >/dev/null
     445            run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    325446        fi
    326447
     
    340461        let "num = num + 1" >/dev/null
    341462        run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
     463        let "num = num + 1" >/dev/null
     464        run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    342465
    343466        #
     
    356479        let "num = num + 1" >/dev/null
    357480        run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
     481        let "num = num + 1" >/dev/null
     482        run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    358483
    359484        #
     
    372497        let "num = num + 1" >/dev/null
    373498        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
    374501
    375502        #
     
    388515        let "num = num + 1" >/dev/null
    389516        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
    390519
    391520        #
     
    404533        let "num = num + 1" >/dev/null
    405534        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
    406537
    407538        #
     
    420551        let "num = num + 1" >/dev/null
    421552        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
    422555
    423556        #
     
    436569        let "num = num + 1" >/dev/null
    437570        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
    438573
    439574        #
     
    452587        let "num = num + 1" >/dev/null
    453588        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
    454591
    455592        # echo; echo "${S}__ TEST CLIENT/SERVER __${E}"; echo;
     
    470607        let "num = num + 1" >/dev/null
    471608        run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
     609        let "num = num + 1" >/dev/null
     610        run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    472611       
    473612        if test -r "Makefile"; then
     
    481620        let "num = num + 1" >/dev/null
    482621        run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
     622        let "num = num + 1" >/dev/null
     623        run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    483624
    484625        #
     
    499640        let "num = num + 1" >/dev/null
    500641        run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
     642        let "num = num + 1" >/dev/null
     643        run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    501644       
    502645        if test -r "Makefile"; then
     
    510653        let "num = num + 1" >/dev/null
    511654        run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
     655        let "num = num + 1" >/dev/null
     656        run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    512657        #
    513658        [ -z "${SMATCH_CC}" ] || { CC="${SMATCH_CC}"; export CC; SMATCH="${SAVE_SMATCH}"; export SMATCH; }
     
    538683            let "num = num + 1" >/dev/null
    539684            run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
     685            let "num = num + 1" >/dev/null
     686            run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    540687            #
    541688            if test -r "Makefile"; then
     
    549696            let "num = num + 1" >/dev/null
    550697            run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
     698            let "num = num + 1" >/dev/null
     699            run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    551700        fi
    552701
     
    567716        let "num = num + 1" >/dev/null
    568717        run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
     718        let "num = num + 1" >/dev/null
     719        run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    569720        #
    570721        if test -r "Makefile"; then
     
    578729        let "num = num + 1" >/dev/null
    579730        run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
     731        let "num = num + 1" >/dev/null
     732        run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    580733
    581734        #
     
    594747        let "num = num + 1" >/dev/null
    595748        run_smatch $? $num debug || let "numfail = numfail + 1"  >/dev/null
     749        let "num = num + 1" >/dev/null
     750        run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    596751        #
    597752        if test -r "Makefile"; then
     
    605760        let "num = num + 1" >/dev/null
    606761        run_smatch $? $num debug || let "numfail = numfail + 1"  >/dev/null
     762        let "num = num + 1" >/dev/null
     763        run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    607764
    608765        #
     
    621778        let "num = num + 1" >/dev/null
    622779        run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
     780        let "num = num + 1" >/dev/null
     781        run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    623782        #
    624783        if test -r "Makefile"; then
     
    632791        let "num = num + 1" >/dev/null
    633792        run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
     793        let "num = num + 1" >/dev/null
     794        run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    634795
    635796        #
     
    648809        let "num = num + 1" >/dev/null
    649810        run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
     811        let "num = num + 1" >/dev/null
     812        run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    650813        #
    651814        if test -r "Makefile"; then
     
    659822        let "num = num + 1" >/dev/null
    660823        run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
     824        let "num = num + 1" >/dev/null
     825        run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    661826
    662827        #
     
    675840        let "num = num + 1" >/dev/null
    676841        run_smatch $? $num debug || let "numfail = numfail + 1"  >/dev/null
     842        let "num = num + 1" >/dev/null
     843        run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    677844        #
    678845        if test -r "Makefile"; then
     
    686853        let "num = num + 1" >/dev/null
    687854        run_smatch $? $num debug || let "numfail = numfail + 1"  >/dev/null
     855        let "num = num + 1" >/dev/null
     856        run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    688857
    689858        #
     
    702871        let "num = num + 1" >/dev/null
    703872        run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
     873        let "num = num + 1" >/dev/null
     874        run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    704875        #
    705876        if test -r "Makefile"; then
     
    713884        let "num = num + 1" >/dev/null
    714885        run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
     886        let "num = num + 1" >/dev/null
     887        run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    715888
    716889        [ -z "${SMATCH}" ] || { CC="${SAVE_CC}"; export CC; }
Note: See TracChangeset for help on using the changeset viewer.