A TypeScript tool to parse and analyze Echidna code coverage reports for Solidity smart contracts.
A TypeScript tool to parse and analyze Echidna code coverage reports for Solidity smart contracts.
- Parse Echidna coverage output files
- Process coverage data into a structured format
- Support for both ESM and CommonJS imports
- TypeScript type definitions included
npm install echidna-coverage-parser
import { readCoverageFileAndProcess } from "echidna-coverage-parser";
import { readFileSync } from "fs";
const file = readFileSync("./coverage.txt", "utf-8");
const data:FileDataWithCoverage = readCoverageFileAndProcess(file, true);
console.log(data);
Returns
export interface FileDataWithCoverage extends FileData {
coverage: CoverageStats;
}
export interface FileData {
path: string;
data: LineData[];
}
export interface CoverageStats {
totalFunctions: number;
coveredLines: number;
revertedLines: number;
untouchedLines: number;
functionCoveragePercentage: number;
lineCoveragePercentage: number;
fullyCoveredFunctions: number;
}
export interface LineData {
functionName: string;
touched: boolean;
reverted: boolean;
isFullyCovered: boolean;
untouchedLines: number;
revertedContent: string[];
untouchedContent: string[];
}