llvm-test-suite: init

This commit is contained in:
2024-07-09 15:08:55 +08:00
parent 6c5a893fbe
commit a95cae429b

27
src/llvm-test-suite.ts Normal file
View File

@@ -0,0 +1,27 @@
import { spawn } from 'child_process';
import * as cmake from 'lyc/commands/cmake';
import path from 'path';
export interface TestSuiteConfigOptions {
buildDir: string;
testSuiteDir: string;
cmakeVariables: Object;
optimizeProfile: 'O0' | 'O2' | 'O3' | string;
}
export function configureTestSuite({
buildDir,
testSuiteDir,
cmakeVariables,
optimizeProfile,
}: TestSuiteConfigOptions) {
// Invoke cmake to configure test suite
return spawn('cmake', [
...cmake.command({
pathToSource: testSuiteDir,
pathToBuild: buildDir,
definitions: cmake.variable(cmakeVariables),
preloadCache: path.resolve(testSuiteDir, 'cmake', 'caches', `${optimizeProfile}.cmake`)
}),
]);
}