spec: introduce getBaseRatios to retrieve ratios from spawn-ed process
This commit is contained in:
@@ -186,6 +186,13 @@ export const baseRatioFromPath = async (path: string) => {
|
||||
return extractBaseRatio(result);
|
||||
};
|
||||
|
||||
export async function getBaseRatios<T extends ChildProcessByStdio<null | Writable, Readable, Readable>>(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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user