]> git.ipfire.org Git - thirdparty/systemd.git/blob - run_gcov.sh
[PATCH] wait_for_sysfs: clean up the logic for the list of devices that we do not...
[thirdparty/systemd.git] / run_gcov.sh
1 #!/bin/sh
2
3 #
4 # run gcov on udev
5 #
6 # Generate code coverage analysis for udev files
7 #
8 # This requires that you compiled udev with gcov flags i.e.
9 # you should have compiled udev with the make_gcov.sh script.
10 #
11 # Leann Ogasawara <ogasawara@osdl.org>, April 2004
12
13 PWD=`pwd`
14
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"
19 exit 1
20 fi
21
22 echo > udev_gcov.txt
23 echo "CODE COVERAGE ANALYSIS FOR UDEV" >> udev_gcov.txt
24 echo >> udev_gcov.txt
25
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
33 else
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
36 fi
37 echo >> udev_gcov.txt
38 done
39
40 echo "udev gcov analysis done. View udev_gcov.txt for results."