diff --git a/src/spec/index.ts b/src/spec/index.ts index de5ca6e..a527cba 100644 --- a/src/spec/index.ts +++ b/src/spec/index.ts @@ -186,6 +186,13 @@ export const baseRatioFromPath = async (path: string) => { return extractBaseRatio(result); }; +export async function getBaseRatios>(proc: T) { + const specResultCSVs = (await watchSPEC(proc)).outputFiles["CSV"]; + assert(specResultCSVs !== undefined && specResultCSVs.length === 1); + const specCSV = await fs.promises.readFile(specResultCSVs[0], "utf-8"); + return extractBaseRatio(parseSPECCSVResultsTable(specCSV)); +} + export interface ParsedResult { [key: string]: SPECResultsTable; }