Last change
on this file since 2513 was 2309, checked in by Bruno Cornec, 15 years ago |
Cosmetic changes to allow for quality to not giv false positive
|
-
Property svn:executable
set to
*
|
File size:
1.6 KB
|
Rev | Line | |
---|
[2213] | 1 | #!/bin/bash
|
---|
| 2 | #
|
---|
| 3 | # $Id$
|
---|
| 4 | #
|
---|
| 5 | # Mesures quality improvement of mondorescue project
|
---|
| 6 | #
|
---|
| 7 |
|
---|
| 8 | # Adapt to your needs
|
---|
| 9 | dname=`dirname $0`
|
---|
| 10 | prem=`echo $dname |cut -c1`
|
---|
| 11 | if [ ${prem} == "/" ]; then
|
---|
| 12 | export TOOLHOME=$dname
|
---|
| 13 | else
|
---|
| 14 | export TOOLHOME=${PWD}/$dname
|
---|
| 15 | fi
|
---|
| 16 |
|
---|
| 17 | d=$TOOLHOME/..
|
---|
| 18 |
|
---|
| 19 | if [ $# -gt 0 ]; then
|
---|
| 20 | if [ -d $1 ]; then
|
---|
| 21 | d=$1
|
---|
| 22 | fi
|
---|
| 23 | fi
|
---|
| 24 |
|
---|
| 25 | echo "Working on $d"
|
---|
| 26 | echo " "
|
---|
| 27 | cd $d
|
---|
| 28 |
|
---|
| 29 | # How many sprintf/strcat/strcpy vs asprintf are they
|
---|
[2309] | 30 | for s in asprintf mr_asprintf sprintf snprintf strcat strcpy strncpy fgets malloc mr_malloc malloc_string getline mr_getline MAX_STR_LEN getcwd goto free mr_free paranoid_free paranoid_system mr_system assert; do
|
---|
| 31 | echo "mondorescue $s usage : "
|
---|
[2213] | 32 | tot=0
|
---|
| 33 | for i in `find . -name '*.c' -o -name '*.h' | egrep -v '\.svn|/\*|monitas|mindi-busybox' | xargs grep -r -c -w $s | egrep -v ":0$"`; do
|
---|
| 34 | echo " === $i"
|
---|
| 35 | ((tot=$tot+`echo $i | cut -d: -f2`))
|
---|
| 36 | done
|
---|
| 37 | echo "total $s usage : $tot"
|
---|
| 38 | done
|
---|
| 39 |
|
---|
| 40 | echo " "
|
---|
| 41 | echo "Qualimetry: "
|
---|
[2309] | 42 | pbg -w asprintf | grep -vE 'monitas|mindi-busybox|quality|/\*|asprintf\(&' > /tmp/mondo.quality
|
---|
[2213] | 43 | cat /tmp/mondo.quality
|
---|
[2309] | 44 | echo "mondorescue uses : `cat /tmp/mondo.quality | wc -l` asprintf without &"
|
---|
| 45 | pbg -w getline | grep -vE 'monitas|mindi-busybox|quality|/\*|getline\(&' > /tmp/mondo.quality
|
---|
[2213] | 46 | cat /tmp/mondo.quality
|
---|
[2309] | 47 | echo "mondorescue uses : `cat /tmp/mondo.quality | wc -l` getline without &"
|
---|
| 48 | pbg mr_asprintf | grep -vE '"|FNAME|ISOFS|syscall_sprintf|mr_mem|quality' > /tmp/mondo.quality
|
---|
| 49 | cat /tmp/mondo.quality
|
---|
| 50 | echo "mondorescue uses : `cat /tmp/mondo.quality | wc -l` mr_asprintf without \""
|
---|
[2213] | 51 | echo " "
|
---|
| 52 | echo "Splint: "
|
---|
| 53 | find . -name '*.c' -o -name '*.h' | xargs splint +posixlib -Dlinux
|
---|
| 54 |
|
---|
| 55 | rm -f /tmp/mondo.quality
|
---|
Note:
See
TracBrowser
for help on using the repository browser.