test_coverage 0.1.0

  • README.md
  • Installing
  • Versions
  • 35

test_coverage #

A simple command-line tool to collect test coverage information from Dart VM tests.

Usage: #

pub global activate coverage # required dependency of test_coverage
pub global activate test_coverage

In the root of your Dart VM project:

# Or
pub global run test_coverage

Result is saved in coverage.lcov.

How it works #

The tool performs following steps:

1. Generates test/.test_coverage.dart file which is essentially a "test all" script.

It is recommended to add this file to your .gitignore.

Below is an example of test/.test_coverage.dart:

// Auto-generated by test_coverage. Do not edit by hand.
// Consider adding this file to your .gitignore.

import 'some_test.dart' as some_test;
import 'nested/other_test.dart' as other_test;
import 'some_other_test.dart' as some_other_test;
void main() {

2. Runs the tests #

Following command is used to run the tests:

dart --pause-isolates-on-exit --enable_asserts --enable-vm-service \

3. Collects and formats coverage information #

When test execution is completed the tool runs collect_coverage and format_coverage commands from the coverage package.

1.0.0 #

  • Initial version, created by Stagehand

Use this package as an executable

1. Install it

You can install the package from the command line:

$ pub global activate test_coverage

2. Use it

The package has the following executables:

$ test_coverage

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  test_coverage: ^0.1.0

2. Install it

You can install packages from the command line:

with pub:

$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:test_coverage/test_coverage.dart';
Version Uploaded Documentation Archive
0.2.3 Jul 26, 2018 Go to the documentation of test_coverage 0.2.3 Download test_coverage 0.2.3 archive
0.2.2 Jul 10, 2018 Go to the documentation of test_coverage 0.2.2 Download test_coverage 0.2.2 archive
0.2.1 Jul 10, 2018 Go to the documentation of test_coverage 0.2.1 Download test_coverage 0.2.1 archive
0.2.0 Jul 9, 2018 Go to the documentation of test_coverage 0.2.0 Download test_coverage 0.2.0 archive
0.1.1 Jun 29, 2018 Go to the documentation of test_coverage 0.1.1 Download test_coverage 0.1.1 archive
0.1.0 Jun 29, 2018 Go to the documentation of test_coverage 0.1.0 Download test_coverage 0.1.0 archive
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Analysis issues and suggestions

Support Dart 2 in pubspec.yaml.

The SDK constraint in pubspec.yaml doesn't allow the Dart 2.0.0 release. For information about upgrading it to be Dart 2 compatible, please see https://dart.dev/dart-2#migration.

Maintenance issues and suggestions

Make sure dartdoc successfully runs on your package's source files. (-10 points)

Dependencies were not resolved.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.66.0 <2.0.0