6 # Generate code coverage analysis for udev files
8 # This requires that you compiled udev with gcov flags i.e.
9 # you should have compiled udev with the make_gcov.sh script.
11 # Leann Ogasawara <ogasawara@osdl.org>, April 2004
15 # check if root else may not have access to *.da files
16 # and gcov analysis will fail.
17 if [ $(id -u) -ne 0 ]; then
18 echo "please become root before executing run_gcov.sh"
23 echo "CODE COVERAGE ANALYSIS FOR UDEV" >> udev_gcov.txt
26 for file in `find -maxdepth 1 -name "*.bb"`; do
27 name=`basename $file .bb`
28 echo "################" >> udev_gcov.txt
29 echo "$name.c" >> udev_gcov.txt
30 echo "################" >> udev_gcov.txt
31 if [ -e "$name.da" ]; then
32 gcov -l "$name.c" >> udev_gcov.txt 2>&1
34 echo "code for $name.c was never executed" >> udev_gcov.txt 2>&1
35 echo "no code coverage analysis to be done" >> udev_gcov.txt 2>&1
40 echo "udev gcov analysis done. View udev_gcov.txt for results."