[mlpack-git] [mlpack/mlpack] Added test coverage framework (#720)

Ryan Curtin notifications at github.com
Tue Jul 12 14:40:22 EDT 2016


> +    find_program(LCOV lcov)
> +
> +    if(NOT GCOV)
> +      message(FATAL_ERROR "gcov not found! Aborting...")
> +    endif()
> +
> +    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage -fno-inline -fno-inline-small-functions -fno-default-inline -fprofile-arcs -fkeep-inline-functions")
> +    message(WARNING "Adding debug options for coverage")
> +    # Remove optimizations for better line coverage
> +    set(DEBUG ON)
> +
> +    if(LCOV)
> +      configure_file(CMake/mlpack_coverage.in mlpack_coverage @ONLY)
> +      add_custom_target(mlpack_coverage DEPENDS mlpack_test COMMAND ${PROJECT_BINARY_DIR}/mlpack_coverage)
> +    else()
> +      message(WARNING "'lcov' not found, local coverage report is disabled. Install 'lcov' and rerun cmake to generate local coverage report.")

I think maybe this one should be `FATAL_ERROR`: if the user builds intentionally with `BUILD_WITH_COVERAGE=ON`, then I assume they would expect to use `mlpack_coverage` afterwards.  But if they don't see this warning, then they will type `make mlpack_coverage` and it won't work, and they will end up confused.  What do you think?

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/pull/720/files/ff02cb500867c83c848d69c3f85c5004b1d9fb4a#r70496924
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160712/f0876722/attachment.html>


More information about the mlpack-git mailing list