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.

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 project'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 'package:coveralls/coveralls.dart';

Future<void> main() async {
  try {
    var coverage = File('/path/to/');
    await Client().upload(await coverage.readAsString());
    print('The report was sent successfully.');

  on Exception catch (err) {
    print('An error occurred: $err');


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.

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.


Send LCOV coverage reports to the Coveralls service.