4 changed files with 234 additions and 229 deletions
@ -1,57 +1,59 @@ |
|||||||
set(tests |
set(tests |
||||||
setIdentity |
setIdentity |
||||||
inverse |
inverse |
||||||
slice |
slice |
||||||
matrixMult |
matrixMult |
||||||
vectorAssignment |
vectorAssignment |
||||||
matrixAssignment |
matrixAssignment |
||||||
matrixScalarMult |
matrixScalarMult |
||||||
transpose |
transpose |
||||||
vector |
vector |
||||||
vector2 |
vector2 |
||||||
vector3 |
vector3 |
||||||
attitude |
attitude |
||||||
filter |
filter |
||||||
integration |
integration |
||||||
squareMatrix |
squareMatrix |
||||||
helper |
helper |
||||||
hatvee |
hatvee |
||||||
copyto |
copyto |
||||||
) |
) |
||||||
|
|
||||||
add_custom_target(test_build) |
add_custom_target(test_build) |
||||||
foreach(test_name ${tests}) |
foreach(test_name ${tests}) |
||||||
add_executable(${test_name} |
add_executable(${test_name} |
||||||
${test_name}.cpp) |
${test_name}.cpp) |
||||||
add_test(test_${test_name} ${test_name}) |
add_test(test_${test_name} ${test_name}) |
||||||
add_dependencies(test_build ${test_name}) |
add_dependencies(test_build ${test_name}) |
||||||
endforeach() |
endforeach() |
||||||
|
|
||||||
if (${CMAKE_BUILD_TYPE} STREQUAL "Coverage") |
if (${CMAKE_BUILD_TYPE} STREQUAL "Coverage") |
||||||
|
|
||||||
add_custom_target(coverage_build |
add_custom_target(coverage_build |
||||||
COMMAND ${CMAKE_CTEST_COMMAND} |
COMMAND ${CMAKE_CTEST_COMMAND} |
||||||
COMMAND lcov --capture --directory . --output-file coverage.info |
COMMAND lcov --capture --directory . --output-file coverage.info |
||||||
COMMAND lcov --summary coverage.info |
COMMAND lcov --summary coverage.info |
||||||
WORKING_DIRECTORY ${CMAKE_BUILD_DIR} |
WORKING_DIRECTORY ${CMAKE_BUILD_DIR} |
||||||
DEPENDS test_build |
DEPENDS test_build |
||||||
) |
) |
||||||
|
|
||||||
add_custom_target(coverage_html |
add_custom_target(coverage_html |
||||||
COMMAND genhtml coverage.info --output-directory out |
COMMAND genhtml coverage.info --output-directory out |
||||||
COMMAND x-www-browser out/index.html |
COMMAND x-www-browser out/index.html |
||||||
WORKING_DIRECTORY ${CMAKE_BUILD_DIR} |
WORKING_DIRECTORY ${CMAKE_BUILD_DIR} |
||||||
DEPENDS coverage_build |
DEPENDS coverage_build |
||||||
) |
) |
||||||
|
|
||||||
set(coverage_deps |
set(coverage_deps |
||||||
coverage_build) |
coverage_build) |
||||||
|
|
||||||
if (COV_HTML) |
if (COV_HTML) |
||||||
list(APPEND coverage_deps coverage_html) |
list(APPEND coverage_deps coverage_html) |
||||||
endif() |
endif() |
||||||
|
|
||||||
add_custom_target(coverage |
add_custom_target(coverage |
||||||
DEPENDS ${coverage_deps} |
DEPENDS ${coverage_deps} |
||||||
) |
) |
||||||
endif() |
endif() |
||||||
|
|
||||||
|
# vim: set et fenc=utf-8 ft=cmake ff=unix sts=0 sw=4 ts=4 : |
||||||
|
Loading…
Reference in new issue