mirror of
https://github.com/systemd/systemd.git
synced 2025-01-26 14:04:03 +03:00
[PATCH] make gcov compile scripts working with recent gcc
This commit is contained in:
parent
8e2bf855bd
commit
e608ba5d45
10
make_gcov.sh
10
make_gcov.sh
@ -16,16 +16,16 @@
|
||||
|
||||
# clean up udev dir
|
||||
clean_udev () {
|
||||
find -name "*.da" -exec rm -f "{}" \;
|
||||
find -name "*.bb" -exec rm -f "{}" \;
|
||||
find -name "*.bbg" -exec rm -f "{}" \;
|
||||
find -name "*.gcno" -exec rm -f "{}" \;
|
||||
find -name "*.gcda" -exec rm -f "{}" \;
|
||||
find -name "*.gcov" -exec rm -f "{}" \;
|
||||
rm -f udev_gcov.txt
|
||||
make clean
|
||||
}
|
||||
|
||||
PWD=`pwd`
|
||||
GCCINCDIR=`gcc -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp"`
|
||||
LIBSYSFS="-I$PWD/libsysfs"
|
||||
LIBSYSFS="-I$PWD/libsysfs/sysfs -I$PWD/libsysfs"
|
||||
WARNINGS="-Wall -Wshadow -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations"
|
||||
GCC="-I$GCCINCDIR"
|
||||
USE_LOG="-DLOG"
|
||||
@ -50,4 +50,4 @@ done
|
||||
|
||||
clean_udev
|
||||
|
||||
make $* CFLAGS="$WARNINGS $GCOV_FLAGS $USE_LOG $DEBUG $GCC $LIBSYSFS"
|
||||
make $* CFLAGS="$WARNINGS $GCOV_FLAGS $USE_LOG $DEBUG $GCC $LIBSYSFS" LDFLAGS="-Wl,-warn-common -fprofile-arcs"
|
||||
|
@ -23,12 +23,12 @@ echo > udev_gcov.txt
|
||||
echo "CODE COVERAGE ANALYSIS FOR UDEV" >> udev_gcov.txt
|
||||
echo >> udev_gcov.txt
|
||||
|
||||
for file in `find -maxdepth 1 -name "*.bb"`; do
|
||||
name=`basename $file .bb`
|
||||
for file in `find -maxdepth 1 -name "*.gcno"`; do
|
||||
name=`basename $file .gcno`
|
||||
echo "################" >> udev_gcov.txt
|
||||
echo "$name.c" >> udev_gcov.txt
|
||||
echo "################" >> udev_gcov.txt
|
||||
if [ -e "$name.da" ]; then
|
||||
if [ -e "$name.gcda" ]; then
|
||||
gcov -l "$name.c" >> udev_gcov.txt 2>&1
|
||||
else
|
||||
echo "code for $name.c was never executed" >> udev_gcov.txt 2>&1
|
||||
|
Loading…
x
Reference in New Issue
Block a user