lcov_parser 0.1.2 copy "lcov_parser: ^0.1.2" to clipboard
lcov_parser: ^0.1.2 copied to clipboard

A simple command-line application. With this package you will get a list of records of lcov.info file.

example/main.dart

import 'package:args/args.dart';
import 'package:lcov_parser/lcov_parser.dart';

void main(List<String> args) async {
  final parser = ArgParser();

  parser.addOption('file');

  final arguments = parser.parse(args);

  final file = arguments['file'] ?? '';
  try {
    final records = await Parser.parse(file);

    var totalHits = 0;
    var totalFinds = 0;
    records.forEach((rec) {
      totalFinds += rec.lines?.found ?? 0;
      totalHits += rec.lines?.hit ?? 0;
    });

    final coverage = (totalHits / totalFinds) * 100;
    print('Total coverage is : $coverage');
  } on FileMustBeProvided {
    print('You need provide a file to parse');
  } catch (e) {
    print(e);
  }
}
3
likes
150
points
91.3k
downloads

Publisher

unverified uploader

Weekly Downloads

A simple command-line application. With this package you will get a list of records of lcov.info file.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

args, collection, path

More

Packages that depend on lcov_parser