import { optFlag, undefList } from "./common" interface SPECOptions { /** * Config file, used for compiling flags, compiler versions, etc. */ config?: string /** * SPEC workload scale for each benchmark */ workload?: "test" | "train" | "ref" /** * Selected benchmarks */ benchmarks?: string[] buildType?: "nobuild" | "rebuild" | "plain", /** * Default: HTML and text * Meaning: Desired report format. * An output format may be deselected by prepending any of the names with the word "no". * If more than one option is used, separate them by commas or colons. * The values are not case-sensitive. */ outputFormat?: ("all" /** config file used for this run, written as a numbered file in the result directory, for example */ | "config" /** Reportable syntax check */ | "check" /** * Comma-separated variable. * If you populate spreadsheets from your runs, * you probably should not cut/paste data from text files; * you'll get more accurate data by using --output_format csv. * The csv report includes all runs, more decimal places, * system information, and even the compiler flags. */ | "csv" | "default" | "flags" | "html" | "mail" | "pdf" | "postscript" | "raw" | "screen" /** Plain ASCII text file */ | "text")[]; } export function runcpuOptions(o: SPECOptions): string[] { return [ ...optFlag("-c", o.config), ...optFlag("-i", o.workload), ...undefList(o.buildType, opt => { switch (opt) { case "nobuild": return ["--nobuild"] case "rebuild": return ["--rebuild"] case "plain": return [] } }), ...undefList(o.benchmarks, bench => bench), ...undefList(o.outputFormat, of => ["--output_format", of.join(",")]), ] }