Changeset 264

Show
Ignore:
Timestamp:
05/30/10 17:44:05 (21 months ago)
Author:
ol
Message:

Change Valgrind leak check to be able to play with Valgrind suppress files. Add curl mode in unit_test

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/test/unit_test

    r122 r264  
    1111list_tmp=._list_tmp 
    1212 
     13#valgrind_opt="--leak-check=yes --run-libc-freeres=no --show-reachable=yes --gen-suppressions=yes" 
    1314valgrind_opt="--leak-check=yes --run-libc-freeres=no --show-reachable=yes" 
    1415 
     
    5152                          -e 's/from.\+$//'                               \ 
    5253                          -e 's/ errors //'` 
    53     valgrind_leak=`grep LEAK $file_tmp | wc -l` 
     54    valgrind_leak=`(grep "definitely lost: 0 bytes in 0 blocks" $file_tmp && grep "indirectly lost: 0 bytes in 0 blocks" $file_tmp && grep "possibly lost: 0 bytes in 0 blocks" $file_tmp && grep "still reachable: 0 bytes in 0 blocks" $file_tmp) | wc -l` 
    5455                         
    5556    echo -n "$unit_id           -> $valgrind_error errors " 
    5657 
    57     if [ $valgrind_leak -eq 0 ] ; then 
     58    if [ $valgrind_leak -eq 4 ] ; then 
    5859      echo " |  No leak detected" 
    5960    else 
     
    9192    echo -n "$unit_id  -> " 
    9293    `which time` -p ./tinyows 2>&1 | grep user | sed -e 's/user //' 
     94 
     95# curl mode 
     96elif [ $mode -eq 8 ]; then 
     97    if [ ! $TINYOWS_CONFIG_FILE ]; then 
     98        TINYOWS_CONFIG_FILE=/usr/local/tinyows/config.xml 
     99    fi 
     100    IP=`grep online_resource $TINYOWS_CONFIG_FILE | sed -e 's/.*online_resource="//' -e 's/".*//'` 
     101    curl -i -H "Content-Type: text/xml" --data @$unit_id $IP 
    93102fi 
     103 
    94104 
    95105done