mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-29 18:23:35 +08:00
code coverage cmake and Jenkins support
This commit is contained in:
@@ -78,7 +78,7 @@ SRC_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
|
||||
define cmake-build
|
||||
+@$(eval BUILD_DIR = $(SRC_DIR)/build/$@$(BUILD_DIR_SUFFIX))
|
||||
+@if [ $(PX4_CMAKE_GENERATOR) = "Ninja" ] && [ -e $(BUILD_DIR)/Makefile ]; then rm -rf $(BUILD_DIR); fi
|
||||
+@if [ ! -e $(BUILD_DIR)/CMakeCache.txt ]; then mkdir -p $(BUILD_DIR) && cd $(BUILD_DIR) && cmake $(2) -G"$(PX4_CMAKE_GENERATOR)" $(CMAKE_ARGS) $(3) || (rm -rf $(BUILD_DIR)); fi
|
||||
+@if [ ! -e $(BUILD_DIR)/CMakeCache.txt ]; then mkdir -p $(BUILD_DIR) && cd $(BUILD_DIR) && cmake $(2) -G"$(PX4_CMAKE_GENERATOR)" $(CMAKE_ARGS) $(3) $(4) || (rm -rf $(BUILD_DIR)); fi
|
||||
+@(cd $(BUILD_DIR) && $(PX4_MAKE) $(PX4_MAKE_ARGS) $(ARGS))
|
||||
endef
|
||||
|
||||
@@ -109,6 +109,19 @@ test_EKF: test_build
|
||||
test_EKF_plots: test_build
|
||||
@cmake --build $(SRC_DIR)/build/test_build --target ecl_EKF_pytest-plots
|
||||
|
||||
|
||||
# Code coverage
|
||||
# --------------------------------------------------------------------
|
||||
|
||||
coverage_build:
|
||||
@$(call cmake-build,$@,$(SRC_DIR), "-DCMAKE_BUILD_TYPE=Coverage", "-DEKF_PYTHON_TESTS=ON")
|
||||
|
||||
coverage: coverage_build
|
||||
@cmake --build $(SRC_DIR)/build/coverage_build --target coverage
|
||||
|
||||
coverage_html: coverage
|
||||
@cmake --build $(SRC_DIR)/build/coverage_build --target coverage_html
|
||||
|
||||
# Cleanup
|
||||
# --------------------------------------------------------------------
|
||||
.PHONY: clean distclean
|
||||
|
||||
Reference in New Issue
Block a user