パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v0.1.3

lcov_parser

LCOVカバレッジファイルを構造化されたレコードに解析し、行、ブランチ、関数のカバレッジデータに簡単にアクセスできるようにするDartパッケージです。

AndroidiOSmacOSWindowsLinux
30日間ダウンロード
38.7万
いいね数
4
Pub ポイント
140

パッケージをインストール

flutter pub add lcov_parser

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

lcov_parser パッケージは、LCOV(Linux カバレッジ)形式のファイルを解析し、行、ブランチ、関数カバレッジ用の構造化データに変換するための Dart ツールです。開発者がテストカバレッジ結果をプログラムで分析できるようにし、CI/CD パイプラインへの統合やレポートの生成を容易にします。このパッケージは複数のプラットフォームをサポートしており、詳細なカバレッジメトリクスを通じて高いコード品質を維持しようとするチームにとって理想的です。

用途

  • テスト実行から LCOV ファイルを解析する
  • CI/CDワークフローへのカバレッジ分析の統合
  • アプリケーションでカバレッジレポートを生成する
  • 時間の経過に伴うコードカバレッジの傾向を分析する
  • プルリクエストでのカバレッジしきい値の検証

主な機能

  • 行、ブランチ、関数カバレッジをサポート
  • 構造化データモデルを提供します
  • Dart プロジェクトとの簡単な統合
  • クロスプラットフォーム互換性
  • 軽量でパースに特化

適している対象

  • テスト自動化エンジニア
  • CI/CD パイプライン開発者
  • コード品質チーム
  • Dart プロジェクトのメンテナー
  • カバレッジレポートジェネレーター

注意事項

  • 有効な LCOV 入力ファイルが必要です
  • カバレッジデータを生成しない。解析のみを行う
  • LCOV形式に限定
  • 組み込みのレポートUIなし
  • LCOV を生成するには、外部のカバレッジツールに依存しています

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

Lcov parser

Dart

A simple lcov file parser implementation in Dart.

The lcov is used to get test coverage. It works as a front-end for gcov collecting the data and generating the coverage info.

This implementation translates the lcov format to Dart classes we can understand and use the coverage info for a lot of proposals.

How to use

To use it is very simple, this package exports the model of the record and the parser class, and you will receive from the return of the parser is a list of record. As you can see in the code below

import 'package:lcov_parser/lcov_parser.dart';

void main() async {
    final file = 'absolute path from lcov.info file';
    final records = await Parser.parse(file);
}

Another option is to parse records from a list of strings:

void main() {
  final lines = [
    'SF:lib/src/interceptors/app_version_interceptor.dart',
    'DA:6,1',
    'DA:11,1',
    // ...more lines here
    'end_of_record',
  ];
  final records = Parser.parseLines(lines);
}

You also will find a script example in the example/main.dart file.

How to contribute with the project.

Feel free to open issues in this repository or open your pull request.

Running the tests

In the root path

dart test

カテゴリー

依存関係

依存関係一覧 3 件

ソースリポジトリ

このパッケージを使用しているプロジェクト