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
CC=g++
COVERAGE_OUTPUT=out
all: unittests sandbox performance sandbox_rtti sandbox_json
@@ -21,10 +22,11 @@ performance: performance.cpp
.PHONY: 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 --remove coverage.info '*/external/*' -o coverage.info
genhtml coverage.info --output-directory out
lcov --remove coverage.info '*/external/*' 'cereal/details/util.hpp' -o coverage.info
genhtml coverage.info --output-directory ${COVERAGE_OUTPUT}
.PHONY: doc
doc:

View File

@@ -2662,3 +2662,10 @@ BOOST_AUTO_TEST_CASE( json_polymorphic )
{
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
# in the gh-pages branch.
make doc
set -e
tempdir=`mktemp -d`
make coverage COVERAGE_OUTPUT=${tempdir}/coverage
make doc
cp -r ./doc/html/ ${tempdir}
git checkout gh-pages
cp -r ${tempdir}/coverage* assets/coverage/
cp -r ${tempdir}/html/* assets/doxygen/
rm -rf ${tempdir}