搜尋套件、儲存庫與 APP 分類

套件詳情v0.1.3

lcov_parser

一個 Dart 套件,可將 LCOV 覆蓋率檔案解析為結構化記錄,提供對行程、分支和函數覆蓋率資料的便捷存取。

AndroidiOSmacOSWindowsLinux
近 30 天下載
36.5萬
喜歡數
4
Pub 分數
140

安裝套件

flutter pub add lcov_parser

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

lcov_parser 套件是一個 Dart 工具,專門用於解析 LCOV(Linux Coverage)格式檔案,將其轉換為結構化資料,以供行、分支及函數覆蓋率使用。它讓開發者能以程式化方式分析測試覆蓋率結果,進而更輕鬆地整合至 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 項

原始碼儲存庫

使用此套件的專案