/** * Cargo Test lens for Rust testing * * cargo test / cargo nextest runs Rust tests. * Output format: JSON Lines with libtest-json format * * @see https://doc.rust-lang.org/cargo/reference/external-tools.html#json-messages * @see https://nexte.st/ */ import { BaseLens } from '../base/BaseLens.js'; import { LensResult, ExecuteResult } from '../../types/index.js'; interface LibtestSuiteResult { type: 'suite'; event: 'ok' | 'failed'; passed: number; failed: number; ignored: number; measured: number; filtered_out: number; exec_time?: number; } interface LibtestTestResult { type: 'test'; event: 'ok' | 'failed' | 'ignored' | 'timeout'; name: string; stdout?: string; stderr?: string; exec_time?: number; reason?: string; } /** * Parsed cargo test output */ interface CargoTestParsedOutput { tests: LibtestTestResult[]; suiteResult?: LibtestSuiteResult; totalTests: number; } /** * Lens for cargo test / cargo nextest */ export declare class CargoTestLens extends BaseLens { readonly name = "cargo-test"; readonly description = "Rust test runner"; readonly languages: string[]; readonly supportedTools: string[]; requirements: import("../..").LensRequirements; private pathMapper?; /** * Calculate quality score (0-100) from test results * * Scoring algorithm: * - Score = (passed / total) * 100 * - Ignored tests don't affect the score */ static calculateQualityScore(result: LensResult): number; /** * Parse libtest JSON output */ parse(output: ExecuteResult): CargoTestParsedOutput; /** * Format cargo test results to standard format */ format(parsed: CargoTestParsedOutput): LensResult; /** * Convert test name to file path (heuristic) * * Test names follow the pattern: crate::module::submodule::test_name * We try to map this to: src/module/submodule.rs or src/module/submodule/mod.rs */ private testNameToFilePath; /** * Get or create path mapper */ private getPathMapper; /** * Prepare command to ensure JSON output format */ prepareCommand(command: string): string; } export {}; //# sourceMappingURL=CargoTestLens.d.ts.map