grinder_coveralls 0.1.0 grinder_coveralls: ^0.1.0 copied to clipboard
Grinder plug-in collecting your code coverage as LCOV and uploading it to the Coveralls service.
Grinder-Coveralls #
Grinder plug-in collecting your code coverage as LCOV and uploading it to the Coveralls service.
Getting started #
If you haven't used Grinder before, be sure to check out the related documentation, as it explains how to create a grind.dart
file and to define project tasks. Once you're familiar with that process, you may install this plug-in.
Installing via Pub #
1. Depend on it #
Add this to your package's pubspec.yaml
file:
devDpendencies:
grinder_coveralls: *
2. Install it #
Install this package and its dependencies from a command prompt:
$ pub get
Once the plug-in has been installed, it may be enabled inside your grind.dart
file.
Usage #
The easy way #
The simplest way to collect and upload your coverage data is to use the dedicated set of functions.
1. Collect the code coverage
import 'package:grinder/grinder.dart';
import 'package:grinder_coveralls/grinder_coveralls.dart';
@Task('Collects the coverage data and saves it as LCOV format')
Future<void> coverageCollect() => collectCoverage(getDir('test'), saveAs: 'lcov.info');
2. Upload the coverage report
import 'package:grinder/grinder.dart';
import 'package:grinder_coveralls/grinder_coveralls.dart';
@Task('Uploads the LCOV coverage report to Coveralls')
Future<void> coverageUpload() async => uploadCoverage(await getFile('lcov.info').readAsString());
The hard way #
This package uses some defaults based on the Pub package layout conventions.
To customize its behavior, you can use the underlying classes used by the helper functions: the Collector
class from this package, and the classes exported from the coveralls
package.
1. Collect the code coverage
TODO
import 'package:grinder/grinder.dart';
import 'package:grinder_coveralls/grinder_coveralls.dart';
2. Format the coverage data
TODO
3. Upload the coverage report
TODO
Examples #
You can find a sample grind.dart
file in the example
folder:
Sample Grinder tasks
Documentation #
Development #
License #
Grinder-Coveralls is distributed under the MIT License.