Skip to content

Commit

Permalink
Ninja compatibility (#32)
Browse files Browse the repository at this point in the history
* ninja compatibility
* bump debian version
  • Loading branch information
psycofdj committed Feb 2, 2018
1 parent ff7e9bd commit 78d8657
Show file tree
Hide file tree
Showing 16 changed files with 391 additions and 138 deletions.
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
xtdmake (1.3.0ppa1~xenial) xenial; urgency=medium

* adds ninja generator compatibility

-- Xavier MARCELET <xavier@marcelet.com> Fri, 02 Feb 2018 17:48:44 +0100

xtdmake (1.2.1ppa1~xenial) xenial; urgency=medium

* update documentation
Expand Down
12 changes: 9 additions & 3 deletions src/check/FindCheckRule.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -264,12 +264,18 @@ function(add_check module)
)

add_custom_target(${module}-check-run-verbose
COMMAND $(MAKE) ${module}-check-build
COMMAND ${CMAKE_MAKE_PROGRAM} ${module}-check-build
COMMAND ${CheckRule_ENV} ctest --output-on-failure -j ${CheckRule_JOBS} -T Test -R "\\(${l_test_regex}\\)" || true)

add_custom_target(${module}-check-run
DEPENDS ${module}-check-build
COMMAND $(MAKE) ${module}-check-run-forced)
COMMAND ${CMAKE_MAKE_PROGRAM} ${module}-check-run-forced)

# Ninja expects his control files in top_builddir
set(l_runTestsCmd ${CMAKE_MAKE_PROGRAM})
if (${CMAKE_GENERATOR} STREQUAL "Ninja")
set(l_runTestsCmd ${CMAKE_MAKE_PROGRAM} -C ${PROJECT_BINARY_DIR})
endif()

add_custom_command(
COMMENT "Generating ${module} tests HTML and XML reports"
Expand All @@ -285,7 +291,7 @@ function(add_check module)
COMMAND mkdir -p ${CheckRule_OUTPUT}
COMMAND rm -rf Testing/
COMMAND touch DartConfiguration.tcl
COMMAND $(MAKE) ${module}-check-run-forced
COMMAND ${l_runTestsCmd} ${module}-check-run-forced
COMMAND cp Testing/*/*.xml ${CheckRule_OUTPUT}/tests.xml
COMMAND ${Xsltproc_EXECUTABLE} ${XTDMake_HOME}/check/stylesheet.xsl ${CheckRule_OUTPUT}/tests.xml > ${CheckRule_OUTPUT}/index.html
COMMAND ${XTDMake_HOME}/check/status.py --module ${module} --input-file ${CheckRule_OUTPUT}/tests.xml --output-file ${CheckRule_OUTPUT}/status.json
Expand Down
14 changes: 8 additions & 6 deletions src/coverage/FindCovRule.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,14 @@ else()
${l_test_list}
${XTDMake_HOME}/coverage/coverage.sh
COMMAND
PROJECT_BINARY_DIR=${PROJECT_BINARY_DIR}
CMAKE_CURRENT_BINARY_DIR="${CMAKE_CURRENT_BINARY_DIR}"
Lcov_EXECUTABLE="${Lcov_EXECUTABLE}"
module="${module}"
CMAKE_CURRENT_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}"
CovRule_EXCLUDE_PATTERNS="${CovRule_EXCLUDE_PATTERNS}"
${XTDMake_HOME}/coverage/coverage.sh
--module "${module}"
--exclude "${CovRule_EXCLUDE_PATTERNS}"
--top-bindir "${PROJECT_BINARY_DIR}"
--bindir "${CMAKE_CURRENT_BINARY_DIR}"
--srcdir "${CMAKE_CURRENT_SOURCE_DIR}"
--make-bin "${CMAKE_MAKE_PROGRAM}"
--lcov-bin "${Lcov_EXECUTABLE}"
)

add_custom_command(
Expand All @@ -101,6 +102,7 @@ else()
DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/coverage.info
${XTDMake_HOME}/coverage/status.py
COMMAND mkdir -p ${CovRule_OUTPUT}/
COMMAND ${Genhtml_EXECUTABLE} -q -o ${CovRule_OUTPUT}/ --function-coverage -t "${module} unit test coverage" --demangle-cpp ${CMAKE_CURRENT_BINARY_DIR}/coverage.info --legend -s
COMMAND ${XTDMake_HOME}/coverage/lcov_cobertura.py ${CMAKE_CURRENT_BINARY_DIR}/coverage.info -d -o ${CovRule_OUTPUT}/coverage.xml
COMMAND ${XTDMake_HOME}/coverage/status.py --module ${module} --input-file=${CovRule_OUTPUT}/coverage.xml --output-file=${CovRule_OUTPUT}/status.json --min-percent=${CovRule_MIN_PERCENT}
Expand Down

0 comments on commit 78d8657

Please sign in to comment.