spec: create new environment
This commit is contained in:
13
spec.ts
13
spec.ts
@@ -356,9 +356,12 @@ export function buildpath(specdir: string, bench: SPECBenchData): string {
|
||||
return path.join(benchmarkDir, 'build');
|
||||
}
|
||||
|
||||
export function setenv(specdir: string): void {
|
||||
process.env.SPEC = specdir;
|
||||
process.env.PATH = `${path.join(specdir, 'bin')}${path.delimiter}${process.env.PATH}`;
|
||||
export function getEnvironment(specdir: string): NodeJS.ProcessEnv {
|
||||
return {
|
||||
...process.env,
|
||||
SPEC: specdir,
|
||||
PATH: `${path.join(specdir, 'bin')}${path.delimiter}${process.env.PATH}`,
|
||||
};
|
||||
}
|
||||
|
||||
export interface SPEC {
|
||||
@@ -366,7 +369,7 @@ export interface SPEC {
|
||||
benchpath: (bench: SPECBenchData) => string;
|
||||
exepath: (bench: SPECBenchData) => string;
|
||||
buildpath: (bench: SPECBenchData) => string;
|
||||
setenv: () => void;
|
||||
getEnvironment: () => NodeJS.ProcessEnv;
|
||||
}
|
||||
|
||||
export function mkSPEC(specRoot: string): SPEC {
|
||||
@@ -377,7 +380,7 @@ export function mkSPEC(specRoot: string): SPEC {
|
||||
benchpath: bench => benchpath(specRoot, bench),
|
||||
exepath: bench => exepath(specRoot, bench),
|
||||
buildpath: bench => buildpath(specRoot, bench),
|
||||
setenv: () => setenv(specRoot),
|
||||
getEnvironment: () => getEnvironment(specRoot),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user