coveralls 2.1.0

  • Installing
  • Versions
  • 61

Coveralls for Dart

Runtime Release License Coverage Build

Send LCOV and Clover coverage reports to the Coveralls service, in Dart.


The latest Dart SDK and Pub versions. If you plan to play with the sources, you will also need the latest Grinder version.


Command line interface

The easy way. From a command prompt, install the coveralls executable:

$ pub global activate coveralls

Consider adding the pub global executables directory to your system path.

Then use it to upload your coverage reports:

$ coveralls --help

Send a coverage report to the Coveralls service.

pub global run coveralls [options] <file>

-h, --help           output usage information
-v, --version        output the version number

For example:

$ coveralls build/

Programming interface

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

  coveralls: *

Then, from a command prompt, install the library:

$ pub get

Now in your Dart code, you can use the Client class to upload your coverage reports:

import 'dart:async';
import 'dart:io';
import 'package:coveralls/coveralls.dart';

Future main() async {
  try {
    var coverage = await new File('/path/to/').readAsString();
    await new Client().upload(coverage);
    print('The report was sent successfully.');
  on Exception catch (err) {
    print('An error occurred: $err');

Supported coverage formats

Currently, this package supports two formats of coverage reports:

  • LCOV: the de facto standard.
  • Clover: a common format produced by Java and PHP test frameworks.

Supported CI services

This project has been tested with Travis CI service, but these services should also work with no extra effort:

Environment variables

If your build system is not supported, you can still use this package. There are a few environment variables that are necessary for supporting your build system:

  • COVERALLS_SERVICE_NAME : the name of your build system.
  • COVERALLS_REPO_TOKEN : the secret repository token from Coveralls.

There are optional environment variables:

  • COVERALLS_SERVICE_JOB_ID : a string that uniquely identifies the build job.
  • COVERALLS_RUN_AT : a date string for the time that the job ran. This defaults to your build system's date/time if you don't set it.

The full list of supported environment variables is available in the source code of the Configuration class (see the fromEnvironment() static method).

The .coveralls.yml file

This package supports the same configuration sources as the Coveralls ones:
Coveralls currently supports

See also


Coveralls for Dart is distributed under the MIT License.


This file contains highlights of what changes on each version of the Coveralls for Dart package.

Version 2.1.0

  • Updated the package dependencies.

Version 2.0.1

  • Fixed a bug: the CLI script doesn't run when using the pub global run command.

Version 2.0.0

  • Breaking change: changed the signature of most class constructors.
  • Breaking change: most class properties are now final.
  • Breaking change: raised the required Dart version.
  • Breaking change: replaced the -f|--file named argument of the CLI script by an anonymous argument (e.g. coveralls instead of coveralls -f
  • Breaking change: the version property is now private.
  • Added support for Clover reports.
  • Changed licensing for the MIT License.
  • Replaced the which module by where.
  • Updated the package dependencies.

Version 1.0.0

  • First stable release.

Version 0.3.0

  • Updated the package dependencies.

Version 0.2.0

  • Updated the package dependencies.

Version 0.1.1

  • Updated the documentation.

Version 0.1.0

  • Initial release.

Use this package as an executable

1. Install it

You can install the package from the command line:

$ pub global activate coveralls

2. Use it

The package has the following executables:

$ coveralls

Use this package as a library

1. Depend on it

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

  coveralls: "^2.1.0"

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter packages get

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

3. Import it

Now in your Dart code, you can use:

      import 'package:coveralls/coveralls.dart';
Version Uploaded Documentation Archive
2.1.0 Nov 3, 2017 Go to the documentation of coveralls 2.1.0 Download coveralls 2.1.0 archive
2.0.1 Sep 15, 2017 Go to the documentation of coveralls 2.0.1 Download coveralls 2.0.1 archive
2.0.0 Sep 15, 2017 Go to the documentation of coveralls 2.0.0 Download coveralls 2.0.0 archive
1.0.0 May 15, 2017 Go to the documentation of coveralls 1.0.0 Download coveralls 1.0.0 archive
0.3.0 Mar 25, 2017 Go to the documentation of coveralls 0.3.0 Download coveralls 0.3.0 archive
0.2.0 Feb 20, 2017 Go to the documentation of coveralls 0.2.0 Download coveralls 0.2.0 archive
0.1.1 Feb 17, 2017 Go to the documentation of coveralls 0.1.1 Download coveralls 0.1.1 archive
0.1.0 Feb 17, 2017 Go to the documentation of coveralls 0.1.0 Download coveralls 0.1.0 archive


We analyzed this package on Jun 12, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.60.0
  • pana: 0.11.3


Describes how popular the package is relative to other packages. [more]
25 / 100
Code health derived from static analysis. [more]
95 / 100
Reflects how tidy and up-to-date the package is. [more]
100 / 100
Overall score:
Weighted score of the above. [more]
Learn more about scoring.


Detected platforms: Flutter, other

Primary library: package:coveralls/coveralls.dart with components: io.


  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 27 hints.

    Run dartfmt to format lib/src/client.dart.

    Run dartfmt to format lib/src/configuration.dart.

    Similar analysis of the following files failed:

    • lib/src/git_commit.dart (hint)
    • lib/src/git_data.dart (hint)
    • lib/src/git_remote.dart (hint)
    • lib/src/job.dart (hint)
    • lib/src/parsers/clover.dart (hint)
    • lib/src/parsers/lcov.dart (hint)
    • lib/src/services/appveyor.dart (hint)
    • lib/src/services/circleci.dart (hint)
    • lib/src/services/codeship.dart (hint)
    • lib/src/services/gitlab_ci.dart (hint)
    • lib/src/services/jenkins.dart (hint)
    • lib/src/services/semaphore.dart (hint)
    • lib/src/services/solano_ci.dart (hint)
    • lib/src/services/surf.dart (hint)
    • lib/src/services/travis_ci.dart (hint)
    • lib/src/services/wercker.dart (hint)
    • lib/src/source_file.dart (hint)
  • Maintain an example.

    Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use coveralls.dart.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.24.0 <2.0.0
args >=0.13.7 <2.0.0 1.4.3
crypto ^2.0.2 2.0.3
http ^0.11.3 0.11.3+16
lcov ^3.0.0 3.1.0 4.0.0
path ^1.4.2 1.6.0
where ^2.1.1 2.2.0 4.0.0
xml ^2.6.0 2.6.0 3.0.0
yaml ^2.1.12 2.1.14
Transitive dependencies
async 2.0.7
charcode 1.1.1
collection 1.14.10
convert 2.0.1
http_parser 3.1.2
matcher 0.12.2+1
meta 1.1.5
petitparser 1.7.6
source_span 1.4.0
stack_trace 1.9.2
string_scanner 1.0.2
typed_data 1.1.5
Dev dependencies
coverage ^0.9.3
grinder ^0.8.0
test ^0.12.27