Skip to content

Instantly share code, notes, and snippets.

@juanpabloaj
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juanpabloaj/9113652 to your computer and use it in GitHub Desktop.
Save juanpabloaj/9113652 to your computer and use it in GitHub Desktop.
#!/bin/bash
# muestra funciones no llamadas desde archivos de test
function usage()
{
echo "usage: `basename $0` script_name.py"
}
# si no recive argumentos
if [ "$#" -ne 1 ] ; then
usage
exit 1
fi
functions=$(egrep "^def" $1 | sed "s/(/\t/" | awk '{print $2}' )
n_functions=$(echo $functions | wc -w )
c=0
for f in $functions
do
if [ "" = "$(grep $f tests/*.*)" ]
then
echo $f
c=$(( $c + 1 ))
fi
done
echo
#echo "funciones testeadas: $(( $n_functions - $c ))""
echo "funciones no testeadas: $c"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment