Permalink
Browse files

Add a "make coverage" target for gcov/lcov output.

Thanks to Paul Bauman for figuring this all out.

Looks like we're only getting 30-40% coverage from "make check" at present.
  • Loading branch information...
roystgnr committed Jan 19, 2013
1 parent b174c5c commit 36284c2565f1ef1e862411318d9a8394eef2793b
Showing with 26,130 additions and 399 deletions.
  1. +30 −0 Makefile.am
  2. +30 −1 Makefile.in
  3. +1 −0 aclocal.m4
  4. +1,801 −329 configure
  5. +8 −1 configure.ac
  6. +5 −1 contrib/Makefile.in
  7. +5 −1 contrib/boost/include/Makefile.in
  8. +5 −1 contrib/exodusii/Lib/Makefile.in
  9. +5 −1 contrib/fparser/Makefile.in
  10. +5 −1 contrib/fparser/extrasrc/Makefile.in
  11. +5 −1 contrib/gmv/Makefile.in
  12. +5 −1 contrib/gzstream/Makefile.in
  13. +5 −1 contrib/laspack/Makefile.in
  14. +491 −0 contrib/lcov/lcov-1.10/CHANGES
  15. +339 −0 contrib/lcov/lcov-1.10/COPYING
  16. +137 −0 contrib/lcov/lcov-1.10/README
  17. +226 −0 contrib/lcov/lcov-1.10/bin/gendesc
  18. +5,799 −0 contrib/lcov/lcov-1.10/bin/genhtml
  19. +3,657 −0 contrib/lcov/lcov-1.10/bin/geninfo
  20. +389 −0 contrib/lcov/lcov-1.10/bin/genpng
  21. +71 −0 contrib/lcov/lcov-1.10/bin/install.sh
  22. +4,303 −0 contrib/lcov/lcov-1.10/bin/lcov
  23. +146 −0 contrib/lcov/lcov-1.10/bin/updateversion.pl
  24. +1 −0 contrib/lcov/lcov-1.10/contrib/galaxy/CHANGES
  25. +48 −0 contrib/lcov/lcov-1.10/contrib/galaxy/README
  26. +195 −0 contrib/lcov/lcov-1.10/contrib/galaxy/conglomerate_functions.pl
  27. +129 −0 contrib/lcov/lcov-1.10/contrib/galaxy/gen_makefile.sh
  28. +1,238 −0 contrib/lcov/lcov-1.10/contrib/galaxy/genflat.pl
  29. +312 −0 contrib/lcov/lcov-1.10/contrib/galaxy/posterize.pl
  30. +2,990 −0 contrib/lcov/lcov-1.10/descriptions.tests
  31. +6 −0 contrib/lcov/lcov-1.10/example/README
  32. +10 −0 contrib/lcov/lcov-1.10/example/descriptions.txt
  33. +60 −0 contrib/lcov/lcov-1.10/example/example.c
  34. +6 −0 contrib/lcov/lcov-1.10/example/gauss.h
  35. +6 −0 contrib/lcov/lcov-1.10/example/iterate.h
  36. +48 −0 contrib/lcov/lcov-1.10/example/methods/gauss.c
  37. +45 −0 contrib/lcov/lcov-1.10/example/methods/iterate.c
  38. +157 −0 contrib/lcov/lcov-1.10/lcovrc
  39. +78 −0 contrib/lcov/lcov-1.10/man/gendesc.1
  40. +569 −0 contrib/lcov/lcov-1.10/man/genhtml.1
  41. +512 −0 contrib/lcov/lcov-1.10/man/geninfo.1
  42. +101 −0 contrib/lcov/lcov-1.10/man/genpng.1
  43. +883 −0 contrib/lcov/lcov-1.10/man/lcov.1
  44. +821 −0 contrib/lcov/lcov-1.10/man/lcovrc.5
  45. +51 −0 contrib/lcov/lcov-1.10/rpm/lcov.spec
  46. +5 −1 contrib/libHilbert/Makefile.in
  47. +5 −1 contrib/metis/Makefile.in
  48. +5 −1 contrib/nanoflann/Makefile.in
  49. +5 −1 contrib/nemesis/Lib/Makefile.in
  50. +5 −1 contrib/netcdf/Lib/Makefile.in
  51. +5 −1 contrib/parmetis/Makefile.in
  52. +5 −1 contrib/sfcurves/Makefile.in
  53. +5 −1 contrib/tecplot/tecio/Makefile.in
  54. +5 −1 contrib/tetgen/Makefile.in
  55. +5 −1 contrib/triangle/Makefile.in
  56. +5 −1 examples/Makefile.in
  57. +5 −1 examples/adaptivity/adaptivity_ex1/Makefile.in
  58. +5 −1 examples/adaptivity/adaptivity_ex2/Makefile.in
  59. +5 −1 examples/adaptivity/adaptivity_ex3/Makefile.in
  60. +5 −1 examples/adaptivity/adaptivity_ex4/Makefile.in
  61. +5 −1 examples/adaptivity/adaptivity_ex5/Makefile.in
  62. +5 −1 examples/adjoints/adjoints_ex1/Makefile.in
  63. +5 −1 examples/adjoints/adjoints_ex2/Makefile.in
  64. +5 −1 examples/adjoints/adjoints_ex3/Makefile.in
  65. +5 −1 examples/adjoints/adjoints_ex4/Makefile.in
  66. +5 −1 examples/eigenproblems/eigenproblems_ex1/Makefile.in
  67. +5 −1 examples/eigenproblems/eigenproblems_ex2/Makefile.in
  68. +5 −1 examples/eigenproblems/eigenproblems_ex3/Makefile.in
  69. +5 −1 examples/fem_system/fem_system_ex1/Makefile.in
  70. +5 −1 examples/introduction/introduction_ex1/Makefile.in
  71. +5 −1 examples/introduction/introduction_ex2/Makefile.in
  72. +5 −1 examples/introduction/introduction_ex3/Makefile.in
  73. +5 −1 examples/introduction/introduction_ex4/Makefile.in
  74. +5 −1 examples/introduction/introduction_ex5/Makefile.in
  75. +5 −1 examples/miscellaneous/miscellaneous_ex1/Makefile.in
  76. +5 −1 examples/miscellaneous/miscellaneous_ex2/Makefile.in
  77. +5 −1 examples/miscellaneous/miscellaneous_ex3/Makefile.in
  78. +5 −1 examples/miscellaneous/miscellaneous_ex4/Makefile.in
  79. +5 −1 examples/miscellaneous/miscellaneous_ex5/Makefile.in
  80. +5 −1 examples/miscellaneous/miscellaneous_ex6/Makefile.in
  81. +5 −1 examples/miscellaneous/miscellaneous_ex7/Makefile.in
  82. +5 −1 examples/miscellaneous/miscellaneous_ex8/Makefile.in
  83. +5 −1 examples/reduced_basis/reduced_basis_ex1/Makefile.in
  84. +5 −1 examples/reduced_basis/reduced_basis_ex2/Makefile.in
  85. +5 −1 examples/reduced_basis/reduced_basis_ex3/Makefile.in
  86. +5 −1 examples/reduced_basis/reduced_basis_ex4/Makefile.in
  87. +5 −1 examples/reduced_basis/reduced_basis_ex5/Makefile.in
  88. +5 −1 examples/reduced_basis/reduced_basis_ex6/Makefile.in
  89. +5 −1 examples/reduced_basis/reduced_basis_ex7/Makefile.in
  90. +5 −1 examples/subdomains/subdomains_ex1/Makefile.in
  91. +5 −1 examples/subdomains/subdomains_ex2/Makefile.in
  92. +5 −1 examples/systems_of_equations/systems_of_equations_ex1/Makefile.in
  93. +5 −1 examples/systems_of_equations/systems_of_equations_ex2/Makefile.in
  94. +5 −1 examples/systems_of_equations/systems_of_equations_ex3/Makefile.in
  95. +5 −1 examples/systems_of_equations/systems_of_equations_ex4/Makefile.in
  96. +5 −1 examples/systems_of_equations/systems_of_equations_ex5/Makefile.in
  97. +5 −1 examples/systems_of_equations/systems_of_equations_ex6/Makefile.in
  98. +5 −1 examples/transient/transient_ex1/Makefile.in
  99. +5 −1 examples/transient/transient_ex2/Makefile.in
  100. +5 −1 examples/vector_fe/vector_fe_ex1/Makefile.in
  101. +5 −1 examples/vector_fe/vector_fe_ex2/Makefile.in
  102. +5 −1 examples/vector_fe/vector_fe_ex3/Makefile.in
  103. +5 −1 include/Makefile.in
  104. +5 −1 include/libmesh/Makefile.in
  105. +96 −0 m4/coverage.m4
  106. +5 −1 tests/Makefile.in
View
@@ -436,3 +436,33 @@ run_examples:
test_headers:
@$(MAKE) -C $(top_builddir)/include/libmesh
@cd $(top_builddir)/include && $(MAKE) test_headers
+
+# -------------------------------------------
+# Optional support for code coverage analysis
+# -------------------------------------------
+
+if CODE_COVERAGE_ENABLED
+
+lcov_dir=$(top_builddir)/doc/lcov/html
+lcov_bin=$(top_srcdir)/contrib/lcov/lcov-1.10/bin
+
+# General philosophy is to maintain code coverage for the
+# base library as generated by "make check" tests.
+
+lcov-report:
+ @mkdir -p $(lcov_dir)
+ $(lcov_bin)/lcov --compat-libtool --directory . --capture --output-file $(lcov_dir)/lcov.info
+ $(lcov_bin)/lcov --list-full-path -l $(lcov_dir)/lcov.info | grep -v "`cd -P $(top_srcdir)/src && pwd`" | cut -d\| -f1 > $(lcov_dir)/remove
+ $(lcov_bin)/lcov -q -r $(lcov_dir)/lcov.info `cat $(lcov_dir)/remove` > $(lcov_dir)/lcov.cleaned.info
+ @rm $(lcov_dir)/remove
+ @mv $(lcov_dir)/lcov.cleaned.info $(lcov_dir)/lcov.info
+ $(lcov_bin)/genhtml -t "libMesh" -o $(lcov_dir) $(lcov_dir)/lcov.info
+
+lcov-reset:
+ @rm -rf $(lcov_dir)
+ @find . -name "*.gcda" -exec rm {} \;
+ $(lcov_bin)/lcov --directory . --zerocounters
+
+coverage: lcov-reset check lcov-report
+
+endif
View
@@ -103,7 +103,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ac_cxx_rtti.m4 \
$(top_srcdir)/m4/ax_tls.m4 $(top_srcdir)/m4/backtrace.m4 \
$(top_srcdir)/m4/boost.m4 $(top_srcdir)/m4/compiler.m4 \
$(top_srcdir)/m4/config_environment.m4 \
- $(top_srcdir)/m4/config_summary.m4 $(top_srcdir)/m4/cppunit.m4 \
+ $(top_srcdir)/m4/config_summary.m4 \
+ $(top_srcdir)/m4/coverage.m4 $(top_srcdir)/m4/cppunit.m4 \
$(top_srcdir)/m4/demangle.m4 $(top_srcdir)/m4/eigen.m4 \
$(top_srcdir)/m4/exodus.m4 $(top_srcdir)/m4/feexcept.m4 \
$(top_srcdir)/m4/fparser.m4 $(top_srcdir)/m4/glpk.m4 \
@@ -3837,6 +3838,7 @@ FGREP = @FGREP@
FLIBS = @FLIBS@
FPARSER_INCLUDE = @FPARSER_INCLUDE@
FPARSER_LIBRARY = @FPARSER_LIBRARY@
+GCOV_FLAGS = @GCOV_FLAGS@
GIT_REVISION = @GIT_REVISION@
GLPK_INCLUDE = @GLPK_INCLUDE@
GLPK_LIBRARY = @GLPK_LIBRARY@
@@ -3847,6 +3849,7 @@ GXX_VERSION = @GXX_VERSION@
GZSTREAM_INCLUDE = @GZSTREAM_INCLUDE@
GZSTREAM_LIB = @GZSTREAM_LIB@
HAVE_DOT = @HAVE_DOT@
+HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -3984,6 +3987,7 @@ dvidir = @dvidir@
enablelegacyincludepaths = @enablelegacyincludepaths@
exec_prefix = @exec_prefix@
gitquery = @gitquery@
+have_gcov = @have_gcov@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
@@ -4685,6 +4689,12 @@ solution_components_dbg_LDADD = libmesh_dbg.la
# Support for libmesh-config in $(exec_prefix)/bin
libmesh_configdir = $(exec_prefix)/bin
libmesh_config_SCRIPTS = contrib/bin/libmesh-config
+
+# -------------------------------------------
+# Optional support for code coverage analysis
+# -------------------------------------------
+@CODE_COVERAGE_ENABLED_TRUE@lcov_dir = $(top_builddir)/doc/lcov/html
+@CODE_COVERAGE_ENABLED_TRUE@lcov_bin = $(top_srcdir)/contrib/lcov/lcov-1.10/bin
all: all-recursive
.SUFFIXES:
@@ -26293,6 +26303,25 @@ test_headers:
@$(MAKE) -C $(top_builddir)/include/libmesh
@cd $(top_builddir)/include && $(MAKE) test_headers
+# General philosophy is to maintain code coverage for the
+# base library as generated by "make check" tests.
+
+@CODE_COVERAGE_ENABLED_TRUE@lcov-report:
+@CODE_COVERAGE_ENABLED_TRUE@ @mkdir -p $(lcov_dir)
+@CODE_COVERAGE_ENABLED_TRUE@ $(lcov_bin)/lcov --compat-libtool --directory . --capture --output-file $(lcov_dir)/lcov.info
+@CODE_COVERAGE_ENABLED_TRUE@ $(lcov_bin)/lcov --list-full-path -l $(lcov_dir)/lcov.info | grep -v "`cd -P $(top_srcdir)/src && pwd`" | cut -d\| -f1 > $(lcov_dir)/remove
+@CODE_COVERAGE_ENABLED_TRUE@ $(lcov_bin)/lcov -q -r $(lcov_dir)/lcov.info `cat $(lcov_dir)/remove` > $(lcov_dir)/lcov.cleaned.info
+@CODE_COVERAGE_ENABLED_TRUE@ @rm $(lcov_dir)/remove
+@CODE_COVERAGE_ENABLED_TRUE@ @mv $(lcov_dir)/lcov.cleaned.info $(lcov_dir)/lcov.info
+@CODE_COVERAGE_ENABLED_TRUE@ $(lcov_bin)/genhtml -t "libMesh" -o $(lcov_dir) $(lcov_dir)/lcov.info
+
+@CODE_COVERAGE_ENABLED_TRUE@lcov-reset:
+@CODE_COVERAGE_ENABLED_TRUE@ @rm -rf $(lcov_dir)
+@CODE_COVERAGE_ENABLED_TRUE@ @find . -name "*.gcda" -exec rm {} \;
+@CODE_COVERAGE_ENABLED_TRUE@ $(lcov_bin)/lcov --directory . --zerocounters
+
+@CODE_COVERAGE_ENABLED_TRUE@coverage: lcov-reset check lcov-report
+
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
View
@@ -1067,6 +1067,7 @@ m4_include([m4/boost.m4])
m4_include([m4/compiler.m4])
m4_include([m4/config_environment.m4])
m4_include([m4/config_summary.m4])
+m4_include([m4/coverage.m4])
m4_include([m4/cppunit.m4])
m4_include([m4/demangle.m4])
m4_include([m4/eigen.m4])
Oops, something went wrong.

0 comments on commit 36284c2

Please sign in to comment.