diff options
author | Richard Hughes <richard@hughsie.com> | 2009-05-28 09:37:22 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2009-05-28 09:37:22 +0100 |
commit | 0e0b909aeb771925b0f179e40c7ee7010dbcf523 (patch) | |
tree | 07ecad95943cb52f54113fa3fa831a0b096eae7d | |
parent | e8a68d6f8766251d49b66cb8c2773222f0c565d6 (diff) |
Remove support for the unused gcov and gprof testing tools
-rw-r--r-- | HACKING | 6 | ||||
-rw-r--r-- | Makefile.am | 23 | ||||
-rw-r--r-- | backends/dummy/.gitignore | 4 | ||||
-rw-r--r-- | backends/test/.gitignore | 5 | ||||
-rw-r--r-- | backends/urpmi/.gitignore | 5 | ||||
-rw-r--r-- | backends/yum/.gitignore | 4 | ||||
-rw-r--r-- | client/.gitignore | 6 | ||||
-rw-r--r-- | configure.ac | 36 | ||||
-rw-r--r-- | lib/packagekit-glib/.gitignore | 5 | ||||
-rw-r--r-- | src/.gitignore | 4 | ||||
-rwxr-xr-x | tools/create-coverage-report.sh | 101 |
11 files changed, 2 insertions, 197 deletions
@@ -63,12 +63,6 @@ Remember: Use 'make security-check' to find obvious security problems. Use "ITS4: ignore" if you are totally 100% sure that it's not a problem. -If you compile with --enable-gcov you can use 'make gcov' to get coverage -reports for the unit test code. -If you compile with --enable-gprof you can use 'make gprof' to get profiling -data - but you probably don't want to be building packages with these options -turned on for obvious reasons. - Submitting Patches ------------------ Use 'git format-patch' to generate patches against a checked out copy diff --git a/Makefile.am b/Makefile.am index 30cb6c3dc..f1d1d39aa 100644 --- a/Makefile.am +++ b/Makefile.am @@ -17,29 +17,11 @@ SUBDIRS = \ $(NULL) clean-local : - rm -f *~ *.bb *.bbg *.da *.gcov .libs/*.da .libs/*.bbg + rm -f *~ security-check: flawfinder `find -name "*.c"` -if PK_BUILD_GCOV -gcov: - make -C src gcov - make -C libpackagekit gcov - cat src/gcov.txt > gcov.txt - cat libpackagekit/gcov.txt >> gcov.txt - cat gcov.txt -endif - -if PK_BUILD_GPROF -gprof: - make -C src gprof - make -C libpackagekit gprof - cat src/gprof.txt > gprof.txt - cat libpackagekit/gprof.txt >> gprof.txt - cat gprof.txt -endif - snapshot: $(MAKE) dist distdir=$(PACKAGE)-$(VERSION)-`date +"%Y%m%d"` @@ -49,8 +31,6 @@ DISTCLEANFILES = \ intltool-extract \ intltool-merge \ intltool-update \ - gcov.txt \ - gprof.txt \ packagekit-decl-list.txt \ packagekit-decl.txt \ packagekit-overrides.txt \ @@ -94,7 +74,6 @@ EXTRA_DIST = \ $(NULL) DISTCHECK_CONFIGURE_FLAGS = \ - --disable-gcov \ --enable-gtk-doc \ --with-security-framework=dummy \ --disable-tests \ diff --git a/backends/dummy/.gitignore b/backends/dummy/.gitignore index 996fb0dc0..c85183357 100644 --- a/backends/dummy/.gitignore +++ b/backends/dummy/.gitignore @@ -7,8 +7,4 @@ Makefile.in *.loT *.o *~ -*.gcov -*.gcda -*.gcno -*.out diff --git a/backends/test/.gitignore b/backends/test/.gitignore index 996fb0dc0..f52b70c0a 100644 --- a/backends/test/.gitignore +++ b/backends/test/.gitignore @@ -7,8 +7,3 @@ Makefile.in *.loT *.o *~ -*.gcov -*.gcda -*.gcno -*.out - diff --git a/backends/urpmi/.gitignore b/backends/urpmi/.gitignore index 996fb0dc0..f52b70c0a 100644 --- a/backends/urpmi/.gitignore +++ b/backends/urpmi/.gitignore @@ -7,8 +7,3 @@ Makefile.in *.loT *.o *~ -*.gcov -*.gcda -*.gcno -*.out - diff --git a/backends/yum/.gitignore b/backends/yum/.gitignore index dbc06a5c7..25e0c4c6a 100644 --- a/backends/yum/.gitignore +++ b/backends/yum/.gitignore @@ -7,10 +7,6 @@ Makefile.in *.loT *.o *~ -*.gcov -*.gcda -*.gcno -*.out *.pyc test diff --git a/client/.gitignore b/client/.gitignore index c0aa98196..443b31d94 100644 --- a/client/.gitignore +++ b/client/.gitignore @@ -11,9 +11,5 @@ pk-self-test *.glade.bak *.gladep *.gladep.bak -*.gcov -*.gcda -*.gcno -*.out -*.pack +*.servicepack diff --git a/configure.ac b/configure.ac index 5569344f7..2593215ee 100644 --- a/configure.ac +++ b/configure.ac @@ -436,14 +436,6 @@ AC_ARG_ENABLE(ruck, AS_HELP_STRING([--enable-ruck],[Build ruck client]), build_ruck=$enableval,build_ruck=yes) AM_CONDITIONAL(PK_BUILD_RUCK, test $build_ruck = "yes") -dnl --------------------------------------------------------------------------- -dnl - Other tests -dnl --------------------------------------------------------------------------- -AC_ARG_ENABLE(gcov, AS_HELP_STRING([--enable-gcov],[compile with coverage profiling instrumentation (gcc only)]), - enable_gcov=$enableval,enable_gcov=no) -AC_ARG_ENABLE(gprof, AS_HELP_STRING([--enable-gprof],[compile with gprof support (gcc only)]), - enable_gprof=$enableval,enable_gprof=no) - # backends AC_ARG_ENABLE(alpm, AS_HELP_STRING([--enable-alpm],[use the ALPM backend]),enable_alpm=$enableval,enable_alpm=no) AC_ARG_ENABLE(apt, AS_HELP_STRING([--enable-apt],[use the APT backend]),enable_apt=$enableval,enable_apt=no) @@ -478,32 +470,6 @@ AM_CONDITIONAL(BACKEND_TYPE_URPMI, [test x$enable_urpmi = xyes]) AM_CONDITIONAL(BACKEND_TYPE_YUM, [test x$enable_yum = xyes]) AM_CONDITIONAL(BACKEND_TYPE_ZYPP, [test x$enable_zypp = xyes]) -if test x$enable_gcov = xyes; then - ## so that config.h changes when you toggle gcov support - AC_DEFINE_UNQUOTED(PK_BUILD_GCOV, 1, [Defined if gcov is enabled to force a rebuild due to config.h changing]) - - AC_MSG_CHECKING([for gcc 3.3 version of gcov file format]) - have_gcc33_gcov=no - AC_RUN_IFELSE( [AC_LANG_PROGRAM( , [[ if (__GNUC__ >=3 && __GNUC_MINOR__ >= 3) exit (0); else exit (1); ]])], - have_gcc33_gcov=yes) - if test x$have_gcc33_gcov = xyes ; then - AC_DEFINE_UNQUOTED(PK_HAVE_GCC33_GCOV, 1, [Defined if we have gcc 3.3 and thus the new gcov format]) - fi - CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage" - AC_MSG_RESULT($have_gcc33_gcov) -fi -AM_CONDITIONAL(PK_BUILD_GCOV, test x$enable_gcov = xyes) - -if test x$enable_gprof = xyes; then - ## so that config.h changes when you toggle gprof support - AC_DEFINE_UNQUOTED(PK_BUILD_GPROF, 1, [Defined if gprof is enabled to force a rebuild due to config.h changing]) - CPPFLAGS="$CPPFLAGS -pg" - LDFLAGS="$LDFLAGS -pg" - CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage" - AC_MSG_RESULT($enable_gprof) -fi -AM_CONDITIONAL(PK_BUILD_GPROF, test x$enable_gprof = xyes) - dnl --------------------------------------------------------------------------- dnl - Are we specifying a different dbus root ? dnl --------------------------------------------------------------------------- @@ -796,8 +762,6 @@ echo " Building unit tests: ${enable_tests} Able to run locally: ${enable_local} Developer warnings: ${enable_developer} - GCC coverage profiling: ${enable_gcov} - GCC time profiling: ${enable_gprof} Security framework: ${with_security_framework} Networking stack: ${with_networking_stack} GIO support: ${with_gio} diff --git a/lib/packagekit-glib/.gitignore b/lib/packagekit-glib/.gitignore index 5d3c4af6c..a013a7d98 100644 --- a/lib/packagekit-glib/.gitignore +++ b/lib/packagekit-glib/.gitignore @@ -7,11 +7,6 @@ *-marshal.h pk-self-test *.loT -*.gcov -*.gcda -*.gcno -*.txt -*.out *.db pk-version.h diff --git a/src/.gitignore b/src/.gitignore index a4507b04b..e66aa01d3 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -7,10 +7,6 @@ org.freedesktop.PackageKit*.h packagekitd pk-self-test debug.log -*.gcov -*.gcda -*.gcno *.txt -*.out *.db diff --git a/tools/create-coverage-report.sh b/tools/create-coverage-report.sh deleted file mode 100755 index a78d9eade..000000000 --- a/tools/create-coverage-report.sh +++ /dev/null @@ -1,101 +0,0 @@ -#!/bin/sh -# Copyright (C) 2008 Richard Hughes <richard@hughsie.com> -# -# Licensed under the GNU General Public License Version 2 -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. - -TOTAL_ACTUAL=0 -TOTAL_COVERED=0 -TOTAL_SOURCE=0 -TOTAL_PERCENT=0 -NOT_TESTED="" - -MODULE=$1 -shift - -process () -{ - if [ -e ".libs/packagekitd" ]; then - gcov $1 &> /dev/null - elif [ -e "src/.libs/packagekitd" ]; then - gcov $1 &> /dev/null - elif [ -e ".libs/libpackagekit.la" ]; then - gcov $1 -o .libs &> /dev/null - elif [ -e "libpackagekit/.libs/libpackagekit.la" ]; then - gcov $1 -o .libs &> /dev/null - else - return - fi - if [ ! -e $1.gcov ]; then - NOT_TESTED="$1,$NOT_TESTED" - return - fi - SOURCE=`cat $1 |wc -l` - ACTUAL=`grep -v " -:" $1.gcov |wc -l` - NOT_COVERED=`grep " #####:" $1.gcov |wc -l` - COVERED=$(($ACTUAL - $NOT_COVERED)) - if [ $ACTUAL -ne 0 ]; then - PERCENT=$((100 * $COVERED / $ACTUAL)) - else - PERCENT=0 - fi - - TOTAL_SOURCE=$(($TOTAL_SOURCE + $SOURCE)) - TOTAL_ACTUAL=$(($TOTAL_ACTUAL + $ACTUAL)) - TOTAL_COVERED=$(($TOTAL_COVERED + $COVERED)) - - echo -n "$1" - - n=${#1} - while [ $n -lt 55 ] ; do - echo -n " " - n=$(($n + 1)) - done - - echo -n " : " - - if [ $PERCENT -lt 10 ] ; then - echo -n " $PERCENT%" - elif [ $PERCENT -lt 100 ] ; then - echo -n " $PERCENT%" - else - echo -n "100%" - fi - - echo " ($COVERED of $ACTUAL)" -} - -echo "==============================================================================" -echo "Test coverage for module $MODULE:" -echo "==============================================================================" - -while [ $# -gt 0 ] ; do - - case "$1" in - "pk-main.c"|"pk-marshal.c"|"pk-security-dummy.c"|"pk-backend-python.c") - #ignore these - ;; - *) - process $1 - ;; - esac - shift -done - -if [ $TOTAL_ACTUAL -ne 0 ]; then - TOTAL_PERCENT=$((100 * $TOTAL_COVERED / $TOTAL_ACTUAL)) -fi -if [ -n "NOT_TESTED" ]; then - echo "NOT TESTED = $NOT_TESTED" -fi - -echo -echo "Source lines : $TOTAL_SOURCE" -echo "Actual statements : $TOTAL_ACTUAL" -echo "Executed statements : $TOTAL_COVERED" -echo "Test coverage : $TOTAL_PERCENT%" -echo - |