Add option to control parallelism of ctest

This commit is contained in:
vector-of-bool 2016-09-15 22:20:35 -06:00
Родитель 785f1caa91
Коммит 88db824085
2 изменённых файлов: 16 добавлений и 3 удалений

Просмотреть файл

@ -153,7 +153,12 @@
"cmake.parallelJobs": {
"type": "number",
"default": 0,
"description": "The number of parallel build/test jobs. Use zero to automatically detect the number of CPUs."
"description": "The number of parallel build jobs. Use zero to automatically detect the number of CPUs."
},
"cmake.ctest.parallelJobs": {
"type": "number",
"default": 0,
"description": "The number of parallel test jobs. Use zero to use the value of cmake.parallelJobs"
},
"cmake.setClangFlags": {
"type": "boolean",

Просмотреть файл

@ -681,6 +681,14 @@ export class CMakeTools {
return os.cpus().length + 2;
}
public get numCTestJobs(): number {
const ctest_jobs = this.config<number>("ctest.parallelJobs");
if (ctest_jobs === 0) {
return this.numJobs;
}
return ctest_jobs;
}
public configure = async function (extra_args: string[] = [], run_prebuild = true): Promise<Number> {
const self: CMakeTools = this;
@ -897,8 +905,8 @@ export class CMakeTools {
}
public ctest = async function (): Promise<Number> {
const self: CMakeTools = this;
return (await self.execute(['-E', 'chdir', self.binaryDir, 'ctest', '-j' + self.numJobs.toString(), '--output-on-failure'])).retc;
const self: CMakeTools = this;
return (await self.execute(['-E', 'chdir', self.binaryDir, 'ctest', '-j' + self.numCTestJobs, '--output-on-failure'])).retc;
}
public quickStart = async function (): Promise<Number> {