[vm] Enable branch coverage by default
Currently if you want branch coverage you have to pass
`--branch-coverage` to both the VM and the coverage collection tool.
This has led to an issue in Flutter where the flag isn't being passed
to the VM, so the branch coverage data is incomplete. It will also
mean that if we add branch coverage support to `package:test`, the
command will have to look like:
`dart --branch-coverage test --branch-coverage ...`
The overhead of the branch coverage instructions is minimal, since
`RecordCoverage` instructions are only inserted in JIT mode anyway. So
it would be better to just enable this flag by default in the VM.
Bug: https://github.com/dart-lang/sdk/issues/60958
Bug: https://github.com/flutter/flutter/issues/171580
Change-Id: Ic6933024cc4aaa4c2476301d507e7a9ee70f7b1e
TEST=CI
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/438640
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
diff --git a/runtime/vm/flag_list.h b/runtime/vm/flag_list.h
index eb7634e..bf5823e 100644
--- a/runtime/vm/flag_list.h
+++ b/runtime/vm/flag_list.h
@@ -249,7 +249,7 @@
P(verify_entry_points, bool, true, \
"Throw API error on invalid member access through native API. See " \
"entry_point_pragma.md") \
- C(branch_coverage, false, false, bool, false, "Enable branch coverage") \
+ C(branch_coverage, false, false, bool, true, "Enable branch coverage") \
C(coverage, false, false, bool, true, "Enable coverage") \
P(use_simulator, bool, true, "Use simulator if available")