2

I would like to know how to use Bulls eye with CMake. I currently have a library and an corresponding executable (with unittests) being build. There were literally no sources but what I can glean from, I came up with this.

FIND_PACKAGE(Bullseye REQUIRED)   #This works fine I have a custom file that locates Bullseye
SET(ENV{COVFILE} "${CMAKE_BINARY_DIRECTORY}/test.cov")

#turn on coverage
SET(RES 1)
EXECUTE_PROCESS(COMMAND ${BULLSEYE_BINARY} -1 RESULT_VARIABLE RES)

#build here
........... common.lib
........... common_test.exe

ADD_CUSTOM_COMMAND(
    TARGET common_test POST_BUILD
    COMMAND ${BULLSEYE_BINARY} -0
)

INSTALL(FILES $ENV{COVFILE} DESTINATION ${COMMON_WIN7_BULLSEYE_OUTPUT_DIR} CONFIGURATIONS Debug)
Nick
  • 1,692
  • 3
  • 21
  • 35
  • See my blog, I have figured it out :) [CMake & Bullseye](http://nickbodd.wordpress.com/2014/10/03/enabling-bullseye-code-coverage-with-cmake/) – Nick Sep 27 '14 at 01:10
  • 1
    I would be interested in your solution, but the link seems broken. Could you update it, please? – theldoria Jul 01 '17 at 05:41
  • blog is gone (but its still on wayback machine) - same code is available in this gist: https://gist.github.com/nbodd/d7316a498cc9868f2ca7 – rasjani Jan 03 '20 at 10:15

0 Answers0