aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2019-12-14 02:02:17 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2019-12-14 02:02:17 +0000
commit40e0c74876c26e28cc6ec61471d19450f35ef82b (patch)
treef827d2e2da4a62840d41bce0447d0e7b9596ca98
parent2d193b6aa8828e948e18e15c731d67ee6bd90c24 (diff)
parent52d141de694be369f335bdbcba13d091807b5755 (diff)
downloadrobolectric-shadows-android10-qpr2-s2-release.tar.gz
Change-Id: Ib5199500a5b9f84011d967fb31eb476d23e467f7
-rw-r--r--report-internal.mk6
1 files changed, 5 insertions, 1 deletions
diff --git a/report-internal.mk b/report-internal.mk
index 498963279..8a16b48f8 100644
--- a/report-internal.mk
+++ b/report-internal.mk
@@ -13,7 +13,10 @@ $(my_coverage_output): PRIVATE_COVERAGE_REPORT_JAR := $(my_coverage_report_jar)
$(my_coverage_output): PRIVATE_REPORT_DIR := $(my_report_dir)
# Generate the coverage report.
+# Touches the output file and continues on failure to avoid breaking the build when a test fails to
+# generate coverage data.
$(my_coverage_output): $(my_collect_file) $(my_coverage_report_jar)
+ $(hide) rm -f $@
$(hide) rm -rf $(PRIVATE_REPORT_DIR)
$(hide) mkdir -p $(PRIVATE_REPORT_DIR)
$(hide) $(JAVA) \
@@ -24,7 +27,8 @@ $(my_coverage_output): $(my_collect_file) $(my_coverage_report_jar)
--name $(PRIVATE_MODULE) \
--report-dir $(PRIVATE_REPORT_DIR)/ \
--srcs $(strip $(call normalize-path-list, $(PRIVATE_INSTRUMENT_SOURCE_DIRS))) \
- >$(PRIVATE_REPORT_DIR)/reporter.txt 2>&1
+ >$(PRIVATE_REPORT_DIR)/reporter.txt 2>&1 \
+ || touch $@
@echo "Coverage report: file://"$(realpath $(PRIVATE_REPORT_DIR))"/index.html"