You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.0 KiB

9 years ago
set(tests
setIdentity
inverse
slice
9 years ago
matrixMult
vectorAssignment
matrixAssignment
matrixScalarMult
transpose
vector
9 years ago
vector2
9 years ago
vector3
9 years ago
attitude
filter
integration
squareMatrix
helper
hatvee
9 years ago
)
9 years ago
add_custom_target(test_build)
foreach(test_name ${tests})
add_executable(${test_name}
${test_name}.cpp)
add_test(test_${test_name} ${test_name})
add_dependencies(test_build ${test_name})
9 years ago
endforeach()
9 years ago
if (${CMAKE_BUILD_TYPE} STREQUAL "Profile")
add_custom_target(coverage_build
COMMAND ${CMAKE_CTEST_COMMAND}
9 years ago
COMMAND lcov --capture --directory . --output-file coverage.info
COMMAND lcov --summary coverage.info
WORKING_DIRECTORY ${CMAKE_BUILD_DIR}
DEPENDS test_build
)
add_custom_target(coverage_html
9 years ago
COMMAND genhtml coverage.info --output-directory out
COMMAND x-www-browser out/index.html
WORKING_DIRECTORY ${CMAKE_BUILD_DIR}
DEPENDS coverage_build
)
set(coverage_deps
coverage_build)
if (COV_HTML)
list(APPEND coverage_deps coverage_html)
endif()
add_custom_target(coverage
DEPENDS ${coverage_deps}
9 years ago
)
endif()