From d5d15c86737f28d9710d4910add969f2198c2087 Mon Sep 17 00:00:00 2001 From: Ivan Lozano Date: Mon, 9 Nov 2020 11:54:26 -0500 Subject: [PATCH] Rust: Collect gnco files with CLANG_COVERAGE too. Until Rust supports LLVM coverage, Soong treats both NATIVE_COVERAGE and CLANG_COVERAGE as producing GCOV coverage files. On the make-side, we should be collecting the gcno files into a zip file when CLANG_COVERAGE is defined too. Bug: 170983066 Test: Coverage build with CLANG_COVERAGE produces zip file. Change-Id: If6f86280f0d823e86884b64729530cc3548103a1 --- core/soong_rust_prebuilt.mk | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/core/soong_rust_prebuilt.mk b/core/soong_rust_prebuilt.mk index dea7340d0..4cfb01f54 100644 --- a/core/soong_rust_prebuilt.mk +++ b/core/soong_rust_prebuilt.mk @@ -82,8 +82,19 @@ ifndef LOCAL_IS_HOST_MODULE endif endif +create_coverage_zip := ifeq ($(NATIVE_COVERAGE),true) + create_coverage_zip := true +endif + +# Until Rust supports LLVM coverage, Soong assumes GCOV coverage in both cases. +# Therefore we should create the coverage zip with the gcno files in this case as well. +ifeq ($(CLANG_COVERAGE),true) + create_coverage_zip := true +endif + +ifdef create_coverage_zip ifneq (,$(strip $(LOCAL_PREBUILT_COVERAGE_ARCHIVE))) $(eval $(call copy-one-file,$(LOCAL_PREBUILT_COVERAGE_ARCHIVE),$(intermediates)/$(LOCAL_MODULE).zip)) ifneq ($(LOCAL_UNINSTALLABLE_MODULE),true)