Working on coverage

This commit is contained in:
Randolph Voorhies
2013-07-10 13:14:02 -07:00
parent 4420489a21
commit cd9d8c4b31
3 changed files with 20 additions and 4 deletions

View File

@@ -1,5 +1,6 @@
CPPFLAGS=-std=c++11 -I./include -Wall -Werror -g CPPFLAGS=-std=c++11 -I./include -Wall -Werror -g
CC=g++ CC=g++
COVERAGE_OUTPUT=out
all: unittests sandbox performance sandbox_rtti sandbox_json all: unittests sandbox performance sandbox_rtti sandbox_json
@@ -21,10 +22,11 @@ performance: performance.cpp
.PHONY: coverage .PHONY: coverage
coverage: coverage:
g++ -std=c++11 -I./include -Wall -Werror -g -O0 -coverage unittests.cpp -o unittests -lboost_unit_test_framework g++ -std=c++11 -I./include -Wall -Werror -g -O0 -coverage unittests.cpp -o unittests_coverage -lboost_unit_test_framework
./unittests_coverage --show_progress
lcov --capture --directory . --output-file coverage.info --no-external lcov --capture --directory . --output-file coverage.info --no-external
lcov --remove coverage.info '*/external/*' -o coverage.info lcov --remove coverage.info '*/external/*' 'cereal/details/util.hpp' -o coverage.info
genhtml coverage.info --output-directory out genhtml coverage.info --output-directory ${COVERAGE_OUTPUT}
.PHONY: doc .PHONY: doc
doc: doc:

View File

@@ -2662,3 +2662,10 @@ BOOST_AUTO_TEST_CASE( json_polymorphic )
{ {
test_polymorphic<cereal::JSONInputArchive, cereal::JSONOutputArchive>(); test_polymorphic<cereal::JSONInputArchive, cereal::JSONOutputArchive>();
} }
namespace mynamespace { struct MyCustomClass {}; }
BOOST_AUTO_TEST_CASE( util )
{
BOOST_CHECK_EQUAL( cereal::util::demangledName<mynamespace::MyCustomClass>(), "mynamespace::MyCustomClass" );
}

View File

@@ -3,14 +3,21 @@
# Updates the doxygen documentation, and copies it into the appropriate place # Updates the doxygen documentation, and copies it into the appropriate place
# in the gh-pages branch. # in the gh-pages branch.
make doc set -e
tempdir=`mktemp -d` tempdir=`mktemp -d`
make coverage COVERAGE_OUTPUT=${tempdir}/coverage
make doc
cp -r ./doc/html/ ${tempdir} cp -r ./doc/html/ ${tempdir}
git checkout gh-pages git checkout gh-pages
cp -r ${tempdir}/coverage* assets/coverage/
cp -r ${tempdir}/html/* assets/doxygen/ cp -r ${tempdir}/html/* assets/doxygen/
rm -rf ${tempdir} rm -rf ${tempdir}