blob: 412549aae2edf549c0dc9891e370bee33f2bdcdf [file]
include(${CMAKE_CURRENT_LIST_DIR}/check-coverage.cmake)
if(RunCMake_TEST_FAILED)
return()
endif()
get_file_element(shared "${coverage_xml}" "Shared.cmake")
if(NOT shared)
string(APPEND RunCMake_TEST_FAILED "No File for Shared.cmake in Coverage.xml\n")
else()
foreach(e IN ITEMS "<FunctionsTested>1</FunctionsTested>" "<FunctionsUnTested>1</FunctionsUnTested>")
string(FIND "${shared}" "${e}" pos)
if(pos EQUAL -1)
string(APPEND RunCMake_TEST_FAILED "Coverage.xml has no ${e} for Shared.cmake:\n${shared}\n")
endif()
endforeach()
endif()
# Number is zero-based, so this is line 2, which both tests ran.
get_file_element(shared_log "${coverage_log_xml}" "Shared.cmake")
string(FIND "${shared_log}" "<Line Number=\"1\" Count=\"2\"" pos)
if(pos EQUAL -1)
string(APPEND RunCMake_TEST_FAILED "CoverageLog-0.xml has no merged count for line 2 of Shared.cmake:\n${shared_log}\n")
endif()
expect_no_file(CMakePrintHelpers.cmake)
expect_no_file(Generated.cmake)