diff --git a/src/llvm-test-suite.ts b/src/llvm-test-suite.ts new file mode 100644 index 0000000..26d2a01 --- /dev/null +++ b/src/llvm-test-suite.ts @@ -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`) + }), + ]); +}