gua-spec: gua spec tests, if needed

This commit is contained in:
2024-06-19 23:16:33 +08:00
parent a26c6a8f4f
commit d396b0d24d

37
gua-spec.ts Normal file
View File

@@ -0,0 +1,37 @@
import { spawn } from "child_process";
import { promisifySpawn } from "cli";
import { runcpuOptions } from "commands/spec";
import { systemdRunOptions } from "commands/systemd";
import { LLVM_INSTALL } from "environment";
import path from "path";
import { defaultSPEC, renderConfig } from "spec";
(async () => {
const llvmHash = "31c8e21f40ea654f9d49b3a926acc6ef1f2ca5d5";
const llvmPrefix = path.join(LLVM_INSTALL, llvmHash);
const config = `clang-O2-${llvmHash}.cfg`;
const spec = defaultSPEC;
spec.newConfig(config, renderConfig({
gccdir: llvmPrefix,
optimize: ["-O2", "-msimd"].join(" "),
}));
await promisifySpawn(spawn("systemd-run", [
...systemdRunOptions({
scope: false,
unit: "spec-loadu",
user: true,
}),
"runcpu",
...runcpuOptions({
benchmarks: ["intspeed"],
buildType: "rebuild",
config,
workload: "ref",
})
], { env: spec.getEnvironment(), }));
})();