lcov_parser 0.1.1 copy "lcov_parser: ^0.1.1" to clipboard
lcov_parser: ^0.1.1 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
pub points
90%
popularity

Publisher

unverified uploader

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