commit | 67b8249d8195873fbfa81fd9c755fe47a9fe2849 | [log] [tgz] |
---|---|---|
author | Chris Bracken <chris@bracken.jp> | Wed Jul 10 11:30:16 2019 +0900 |
committer | GitHub <noreply@github.com> | Wed Jul 10 11:30:16 2019 +0900 |
tree | c92c6384894ee0f75d45279f7f680c14771f570a | |
parent | b7b11cb00c1195010c11aa3dff59ad50a4f3e984 [diff] |
Skip dart: sources by default (#257) Skips collecting coverage for VM scripts with URIs with scheme 'dart'. There's a lot of this source, most users aren't interested in collecting coverage for it, and those who do, can still get at it by passing the `--include-dart` flag if they want it.
Coverage provides coverage data collection, manipulation, and formatting for Dart.
collect_coverage
collects coverage JSON from the Dart VM Observatory. format_coverage
formats JSON coverage data into either LCOV or pretty-printed format.
pub global activate coverage
Consider adding the pub global run
executables directory to your path. See Running a script from your PATH for more details.
dart --pause-isolates-on-exit --enable-vm-service=NNNN script.dart pub global run coverage:collect_coverage --uri=http://... -o coverage.json --resume-isolates
or if the pub global run
executables are on your PATH,
collect_coverage --uri=http://... -o coverage.json --resume-isolates
where --uri
specifies the Observatory URI emitted by the VM.
If collect_coverage
is invoked before the script from which coverage is to be collected, it will wait until it detects a VM observatory to which it can connect. An optional --connect-timeout
may be specified (in seconds). The --wait-paused
flag may be enabled, causing collect_coverage
to wait until all isolates are paused before collecting coverage.
pub global run coverage:format_coverage --packages=app_package/.packages -i coverage.json
or if the pub global run
exectuables are on your PATH,
format_coverage --packages=app_package/.packages -i coverage.json
where app_package
is the path to the package whose coverage is being collected. If --sdk-root
is set, Dart SDK coverage will also be output.