Skip to content

Commit

Permalink
Refs #11832. All of framework except SINQ covered.
Browse files Browse the repository at this point in the history
  • Loading branch information
quantumsteve committed May 22, 2015
1 parent 97f0a67 commit cf49aef
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 8 deletions.
13 changes: 12 additions & 1 deletion Code/Mantid/Build/CMake/CoverallsGenerateGcov.cmake
Expand Up @@ -59,11 +59,22 @@ if (NOT PROJECT_ROOT)
message(FATAL_ERROR "Coveralls: Missing PROJECT_ROOT.")
endif()


file(READ "sources.txt" COVERAGE_SRCS)

string(REGEX REPLACE "\n" ";" COVERAGE_SRCS ${COVERAGE_SRCS})
string(STRIP "${COVERAGE_SRCS}" COVERAGE_SRCS)
foreach(ITEM ${COVERAGE_SRCS})
message(STATUS "ITEM:${ITEM}")
endforeach()
message(STATUS "${COVERAGE_SRCS}")


# Since it's not possible to pass a CMake list properly in the
# "1;2;3" format to an external process, we have replaced the
# ";" with "*", so reverse that here so we get it back into the
# CMake list format.
string(REGEX REPLACE "\\*" ";" COVERAGE_SRCS ${COVERAGE_SRCS})
#string(REGEX REPLACE "\\*" ";" COVERAGE_SRCS ${COVERAGE_SRCS})

find_program(GCOV_EXECUTABLE gcov)

Expand Down
10 changes: 9 additions & 1 deletion Code/Mantid/CMakeLists.txt
Expand Up @@ -207,8 +207,16 @@ add_subdirectory ( Testing/SystemTests/scripts )

if (COVERALLS)
get_property(ALL_SRCS GLOBAL PROPERTY COVERAGE_SRCS)
set(SRCS_FILE "")
foreach (SRC ${ALL_SRCS})
set(SRCS_FILE "${SRCS_FILE}\n${SRC}")
endforeach()
#remove initial \n
string(SUBSTRING ${SRCS_FILE} 1 -1 SRCS_FILE)
set( SRCS_FILENAME "${CMAKE_CURRENT_BINARY_DIR}/sources.txt")
file(WRITE ${SRCS_FILENAME} ${SRCS_FILE})
coveralls_setup(
"${ALL_SRCS}"
${SRCS_FILENAME}
OFF
"${CMAKE_SOURCE_DIR}/Build/CMake"
)
Expand Down
1 change: 0 additions & 1 deletion Code/Mantid/Framework/API/CMakeLists.txt
Expand Up @@ -405,7 +405,6 @@ set ( GMOCK_TEST_FILES

if (COVERALLS)
foreach( loop_var ${SRC_FILES} ${INC_FILES} )
message(STATUS "loop_var:${loop_var}")
set_property(GLOBAL APPEND PROPERTY COVERAGE_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/${loop_var}")
endforeach(loop_var)
endif()
Expand Down
10 changes: 5 additions & 5 deletions Code/Mantid/Framework/SINQ/CMakeLists.txt
Expand Up @@ -130,11 +130,11 @@ set ( TEST_FILES
UncertainValueTest.h
)

if (COVERALLS)
foreach( loop_var ${SRC_FILES} ${INC_FILES})
set_property(GLOBAL APPEND PROPERTY COVERAGE_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/${loop_var}")
endforeach(loop_var)
endif()
#if (COVERALLS)
# foreach( loop_var ${SRC_FILES} ${INC_FILES})
# set_property(GLOBAL APPEND PROPERTY COVERAGE_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/${loop_var}")
# endforeach(loop_var)
#endif()

# Add a precompiled header where they are supported
enable_precompiled_headers ( inc/MantidSINQ/PrecompiledHeader.h SRC_FILES )
Expand Down

0 comments on commit cf49aef

Please sign in to comment.