Skip to content

Commit

Permalink
give test coverage reports some love
Browse files Browse the repository at this point in the history
  • Loading branch information
novas0x2a committed Sep 15, 2009
1 parent 818b5b3 commit ac91c01
Show file tree
Hide file tree
Showing 12 changed files with 48 additions and 513 deletions.
49 changes: 34 additions & 15 deletions Makefile.am
Expand Up @@ -42,10 +42,44 @@ if DIST_REMOVE_MODULES
( cd $(distdir) && autoreconf && touch src/vw/config.h.pre.in && rm -rf autom4te.cache )
endif

all-local:
if ENABLE_TEST_COVERAGE
$(LCOV) --follow --capture --test-name 'Vision-Workbench-Base' --directory $(top_srcdir) --output-file vw-base.trace --initial
$(LCOV) --follow -e vw-base.trace '*/src/vw/*' -o vw-base.trace
$(LCOV) --follow -r vw-base.trace '*/tests/*' -o vw-base.trace
$(LCOV) --follow -r vw-base.trace '*/tools/*' -o vw-base.trace
$(LCOV) --follow -r vw-base.trace '*/gui/*' -o vw-base.trace
endif

check-local:
@echo ==============================
@echo All tests passed successfully!
@echo ==============================
if ENABLE_TEST_COVERAGE
$(LCOV) --follow --capture --test-name 'Vision-Workbench' --directory $(top_srcdir) --output-file vw-test.trace
$(LCOV) --follow -e vw-test.trace '*/src/vw/*' -o vw-test.trace
$(LCOV) --follow -r vw-test.trace '*/tests/*' -o vw-test.trace
$(LCOV) --follow -r vw-test.trace '*/tools/*' -o vw-test.trace
$(LCOV) --follow -r vw-test.trace '*/gui/*' -o vw-test.trace
$(LCOV) --follow -a vw-base.trace -a vw-test.trace -o vw.trace
$(GENHTML) -o $(top_srcdir)/coverage vw.trace
@echo "Generated code coverage report in $(top_srcdir)/coverage"
endif

coverage:
$(LCOV) --follow --capture --test-name 'Vision-Workbench-Base' --directory $(top_srcdir) --output-file vw-base.trace --initial
$(LCOV) --follow -e vw-base.trace '*/src/vw/*' -o vw-base.trace
$(LCOV) --follow -r vw-base.trace '*/tests/*' -o vw-base.trace
$(LCOV) --follow -r vw-base.trace '*/tools/*' -o vw-base.trace
$(LCOV) --follow -r vw-base.trace '*/gui/*' -o vw-base.trace
$(LCOV) --follow --capture --test-name 'Vision-Workbench' --directory $(top_srcdir) --output-file vw-test.trace
$(LCOV) --follow -e vw-test.trace '*/src/vw/*' -o vw-test.trace
$(LCOV) --follow -r vw-test.trace '*/tests/*' -o vw-test.trace
$(LCOV) --follow -r vw-test.trace '*/tools/*' -o vw-test.trace
$(LCOV) --follow -r vw-test.trace '*/gui/*' -o vw-test.trace
$(LCOV) --follow -a vw-base.trace -a vw-test.trace -o vw.trace
$(GENHTML) -o $(top_srcdir)/coverage vw.trace
@echo "Generated code coverage report in $(top_srcdir)/coverage"

distclean-local:
cd docs/workbook && $(MAKE) $(AM_MAKEFLAGS) distclean
Expand All @@ -58,21 +92,6 @@ doxygen:

doc: workbook doxygen

coverage:
$(LCOV) --capture --test-name 'Vision-Workbench-Base' --directory $(top_srcdir) --output-file vw-base.trace --initial
$(LCOV) -e vw-base.trace '*/src/vw/*' -o vw-base.trace
$(LCOV) -r vw-base.trace '*/tests/*' -o vw-base.trace
$(LCOV) -r vw-base.trace '*/tools/*' -o vw-base.trace
$(LCOV) -r vw-base.trace '*/gui/*' -o vw-base.trace
$(LCOV) --capture --test-name 'Vision-Workbench' --directory $(top_srcdir) --output-file vw-test.trace
$(LCOV) -e vw-test.trace '*/src/vw/*' -o vw-test.trace
$(LCOV) -r vw-test.trace '*/tests/*' -o vw-test.trace
$(LCOV) -r vw-test.trace '*/tools/*' -o vw-test.trace
$(LCOV) -r vw-test.trace '*/gui/*' -o vw-test.trace
$(LCOV) -a vw-base.trace -a vw-test.trace -o vw.trace
$(GENHTML) -o $(top_srcdir)/coverage vw.trace
@echo "Generated code coverage report in $(top_srcdir)/coverage"

push-coverage:
if test -n "$(LCOV_REMOTE_PATH)" ; then rsync -P -e ssh -r coverage/ $(LCOV_REMOTE_PATH); fi

Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Expand Up @@ -131,7 +131,7 @@ if test "$ENABLE_TEST_COVERAGE" = "yes"; then
fi

# Files test-coverage and profile-arcs generate
AC_SUBST([MOSTLYCLEANFILES], "*.bb *.bbg *.da *.gcov *.gcda *.gcno")
AC_SUBST([MOSTLYCLEANFILES], "*.bb *.bbg *.da *.gcov *.gcda *.gcno .*.gcov")

# These need to be here because automake-1.6 is dumb and does not properly
# process AM_CONDITIONALs unless the first argument is a simple string.
Expand Down
7 changes: 2 additions & 5 deletions src/vw/Core/tests/TestInstantiateFree.cxx
Expand Up @@ -5,7 +5,7 @@
// __END_LICENSE__


#include <cxxtest/TestSuite.h>
#include <gtest/gtest.h>
#include <string>
#include <vw/Core.h>
#include <vw/Image/PixelTypes.h>
Expand All @@ -28,7 +28,4 @@ typedef PixelRGBA<int> PixelT;

#include "TestInstantiateFreeList.hh"

class TestInstantiateCoreFree : public CxxTest::TestSuite
{
public: void test_inst() {}
};
TEST(InstantiateCoreFree, Inst) {}
2 changes: 1 addition & 1 deletion src/vw/Core/tests/TestInstantiateFreeList.hh
Expand Up @@ -13,4 +13,4 @@ template vw::CompoundResult<FuncT, ArgT, void>::type vw::compound_apply < FuncT,
//template ResultT vw::compound_select_channel < ResultT,PixelT > (const PixelT&, boost::enable_if<boost::mpl::and_<boost::mpl::not_<vw::IsCompound<PixelT> >::type, boost::mpl::not_<boost::is_reference<T>::type>::type, mpl_::bool_<true>, mpl_::bool_<true>, mpl_::bool_<true> >, int>::type);
template ResultT vw::compound_select_channel < ResultT,PixelT > (const PixelT&, boost::enable_if<boost::mpl::and_<vw::IsCompound<PixelT>, boost::mpl::not_<boost::is_reference<T>::type>::type, mpl_::bool_<true>, mpl_::bool_<true>, mpl_::bool_<true> >, int>::type);
template boost::enable_if<vw::IsScalarOrCompound<T>, double>::type vw::mean_channel_value < T > (const T&);
template string vw::stringify < T > (const T&);
template std::string vw::stringify < T > (const T&);
7 changes: 2 additions & 5 deletions src/vw/Core/tests/TestInstantiateRecord.cxx
Expand Up @@ -5,7 +5,7 @@
// __END_LICENSE__


#include <cxxtest/TestSuite.h>
#include <gtest/gtest.h>
#include <string>
#include <vw/Core.h>
#include <vw/Image/PixelTypes.h>
Expand Down Expand Up @@ -68,7 +68,4 @@ struct ResultT

#include "TestInstantiateRecordList.hh"

class TestInstantiateCoreRecord : public CxxTest::TestSuite
{
public: void test_inst() {}
};
TEST(InstantiateCoreRecord, Inst) {}

0 comments on commit ac91c01

Please sign in to comment.