Skip to content

Commit

Permalink
try adding code coverage / coveralls upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Dane Springmeyer committed Jan 15, 2015
1 parent 199b3ec commit 11e6528
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ test: out/unit
./out/unit
./out/optional_unit

coverage:
mkdir -p ./out
$(CXX) -o out/cov-test --coverage test/unit.cpp -I./ $(DEBUG_FLAGS) $(COMMON_FLAGS) $(CXXFLAGS) $(LDFLAGS)

sizes: Makefile variant.hpp
mkdir -p ./out
@$(CXX) -o ./out/variant_hello_world.out variant.hpp $(RELEASE_FLAGS) $(COMMON_FLAGS) $(CXXFLAGS) && du -h ./out/variant_hello_world.out
Expand All @@ -83,6 +87,8 @@ profile: out/bench-variant-debug
clean:
rm -rf ./out
rm -rf *.dSYM
rm -f unit.gc*
rm -f *gcov

pgo: out Makefile variant.hpp
$(CXX) -o out/bench-variant test/bench_variant.cpp -I./ $(RELEASE_FLAGS) $(COMMON_FLAGS) $(CXXFLAGS) $(LDFLAGS) $(BOOST_LIBS) -pg -fprofile-generate
Expand Down
11 changes: 11 additions & 0 deletions scripts/linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,17 @@ make clean
echo 'testing build with gyp'
make gyp

# run coverage when using clang++
if [[ $CXX == "clang++" ]];
make clean
make coverage
git status
cp unit*gc* test/
./out/cov-test
sudo pip install cpp-coveralls
coveralls -i variant.hpp --gcov-options '\-lp'
fi

# set strictness back to normal
# to avoid tripping up travis
set +e +u

0 comments on commit 11e6528

Please sign in to comment.