source: trunk/tools/quality @ 127

Last change on this file since 127 was 121, checked in by bcornec, 14 years ago

small memory bugs fixed in newt-specific.c and libmondo-string.c

  • Property svn:executable set to *
File size: 1.3 KB
Line 
1#!/bin/bash
2#
3# $Id$
4#
5# Mesures quality improvement of mondorescue project
6#
7
8# Adapt to your needs
9dname=`dirname $0`
10prem=`echo $dname |cut -c1`
11if [ ${prem} == "/" ]; then
12        export TOOLHOME=$dname
13else
14        export TOOLHOME=${PWD}/$dname
15fi
16
17d=$TOOLHOME/..
18
19if [ $# -gt 0 ]; then
20    if [ -d $1 ]; then
21        d=$1
22    fi
23fi
24
25echo "Working on $d"
26echo " "
27cd $d
28
29# How many sprintf/strcat/strcpy vs asprintf are they
30for s in asprintf sprintf strcat strcpy fgets malloc_string MAX_STR_LEN goto; do
31    echo "monodrescue $s usage : "
32    for i in `find . -name '*.c' -o -name '*.h' |  egrep -v '\.svn' | egrep -v '/\*' | xargs grep -r -c -w $s | egrep -v ":0$"`; do
33            echo " === $i"
34    done
35done
36
37echo " "
38echo "Qualimetry: "
39find . -name '*.c' -o -name '*.h' |  egrep -v '\.svn' | xargs grep -r asprintf | egrep -v '/\*' | egrep -v 'asprintf\(&' > /tmp/mondo.quality
40cat /tmp/mondo.quality
41echo "monodrescue uses : `cat /tmp/mondo.quality | wc -l` asprintf without &"
42find . -name '*.c' -o -name '*.h' |  egrep -v '\.svn' | xargs grep -r getline | egrep -v '/\*' | egrep -v 'getline\(&' > /tmp/mondo.quality
43cat /tmp/mondo.quality
44echo "monodrescue uses : `cat /tmp/mondo.quality | wc -l` getline without &"
45
46echo " "
47echo "Splint: "
48find . -name '*.c' -o -name '*.h' | xargs splint +posixlib -Dlinux
49
50rm -f /tmp/mondo.quality
Note: See TracBrowser for help on using the repository browser.