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');
|
return path.join(benchmarkDir, 'build');
|
||||||
}
|
}
|
||||||
|
|
||||||
export function setenv(specdir: string): void {
|
export function getEnvironment(specdir: string): NodeJS.ProcessEnv {
|
||||||
process.env.SPEC = specdir;
|
return {
|
||||||
process.env.PATH = `${path.join(specdir, 'bin')}${path.delimiter}${process.env.PATH}`;
|
...process.env,
|
||||||
|
SPEC: specdir,
|
||||||
|
PATH: `${path.join(specdir, 'bin')}${path.delimiter}${process.env.PATH}`,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SPEC {
|
export interface SPEC {
|
||||||
@@ -366,7 +369,7 @@ export interface SPEC {
|
|||||||
benchpath: (bench: SPECBenchData) => string;
|
benchpath: (bench: SPECBenchData) => string;
|
||||||
exepath: (bench: SPECBenchData) => string;
|
exepath: (bench: SPECBenchData) => string;
|
||||||
buildpath: (bench: SPECBenchData) => string;
|
buildpath: (bench: SPECBenchData) => string;
|
||||||
setenv: () => void;
|
getEnvironment: () => NodeJS.ProcessEnv;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function mkSPEC(specRoot: string): SPEC {
|
export function mkSPEC(specRoot: string): SPEC {
|
||||||
@@ -377,7 +380,7 @@ export function mkSPEC(specRoot: string): SPEC {
|
|||||||
benchpath: bench => benchpath(specRoot, bench),
|
benchpath: bench => benchpath(specRoot, bench),
|
||||||
exepath: bench => exepath(specRoot, bench),
|
exepath: bench => exepath(specRoot, bench),
|
||||||
buildpath: bench => buildpath(specRoot, bench),
|
buildpath: bench => buildpath(specRoot, bench),
|
||||||
setenv: () => setenv(specRoot),
|
getEnvironment: () => getEnvironment(specRoot),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user