From 9e37b99d767a76071cd92a739552a45811c53111 Mon Sep 17 00:00:00 2001 From: jgoppert Date: Wed, 4 Nov 2015 11:38:55 -0500 Subject: [PATCH] Added local coverage tools. --- .travis.yml | 2 +- CMakeLists.txt | 15 +++++++++++---- matrix/Quaternion.hpp | 2 +- test/instantiation.cpp | 4 ++++ 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 33cccab7bd..a4b0894d68 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: c script: -- mkdir -p build && cd build && cmake -DCOVERALLS=ON -DCMAKE_BUILD_TYPE=Debug .. && + - mkdir -p build && cd build && cmake -DCOVERALLS=ON -DCOVERALLS_UPLOAD=ON -DCMAKE_BUILD_TYPE=Debug .. && make && ctest -V && make coveralls env: global: diff --git a/CMakeLists.txt b/CMakeLists.txt index 20df2934dd..bfbaef599d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,7 @@ set(VERSION_PATCH "0") project(matrix CXX) option(COVERALLS "Turn on coveralls support" OFF) -option(COVERALLS_UPLOAD "Upload the generated coveralls json" ON) +option(COVERALLS_UPLOAD "Upload the generated coveralls json" OFF) if (NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build type" FORCE) @@ -26,14 +26,21 @@ set(CMAKE_CXX_FLAGS ) if (COVERALLS) - include(Coveralls) - coveralls_turn_on_coverage() list(APPEND CMAKE_CXX_FLAGS -fno-inline -fno-inline-small-functions -fno-default-inline --coverage ) + include(Coveralls) + coveralls_turn_on_coverage() + add_custom_target(coverage + COMMAND lcov --capture --directory . --output-file coverage.info + COMMAND genhtml coverage.info --output-directory out + COMMAND firefox out/index.html + WORKING_DIRECTORY ${CMAKE_BUILD_DIR} + DEPENDS coveralls + ) endif() string(REPLACE ";" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") @@ -42,7 +49,7 @@ enable_testing() include_directories(matrix) -file(GLOB_RECURSE COV_SRCS matrix/*.hpp matrix/*.cpp) +file(GLOB_RECURSE COV_SRCS matrix/*.hpp matrix/*.cpp test/*.hpp test/*.cpp) # Setup the coveralls target and tell it to gather # coverage data for all the lib sources. diff --git a/matrix/Quaternion.hpp b/matrix/Quaternion.hpp index ca142a4696..677dd219a4 100644 --- a/matrix/Quaternion.hpp +++ b/matrix/Quaternion.hpp @@ -88,7 +88,7 @@ public: return r; } - Matrix derivative(const Matrix & w) const { + Matrix derivative(const Vector & w) const { const Quaternion &q = *this; Type dataQ[] = { q(0), -q(1), -q(2), -q(3), diff --git a/test/instantiation.cpp b/test/instantiation.cpp index 6246833526..9f425d0713 100644 --- a/test/instantiation.cpp +++ b/test/instantiation.cpp @@ -10,8 +10,12 @@ namespace matrix { template class Vector; +template class Vector; +template class Vector; template class Euler; template class Scalar; template class Matrix; +template class Matrix; +template class Quaternion; };