File tree 3 files changed +18
-1
lines changed
3 files changed +18
-1
lines changed Original file line number Diff line number Diff line change 158
158
"default" : {},
159
159
"description" : " Specify the list of additional environment variables used for running tests."
160
160
},
161
+ "mesonbuild.testJobs" : {
162
+ "type" : " integer" ,
163
+ "default" : -1 ,
164
+ "minimum" : -1 ,
165
+ "description" : " Specify the maximum number of tests executed in parallel. -1 for number of CPUs, 0 for unlimited."
166
+ },
161
167
"mesonbuild.benchmarkOptions" : {
162
168
"type" : " array" ,
163
169
"default" : [
Original file line number Diff line number Diff line change @@ -109,7 +109,17 @@ export async function testRunHandler(
109
109
}
110
110
111
111
const running_tests : Promise < void > [ ] = [ ] ;
112
- const max_running = os . cpus ( ) . length ;
112
+ const max_running : number = ( ( ) => {
113
+ const jobs_config = extensionConfiguration ( "testJobs" ) ;
114
+ switch ( jobs_config ) {
115
+ case - 1 :
116
+ return os . cpus ( ) . length ;
117
+ case 0 :
118
+ return Number . MAX_SAFE_INTEGER ;
119
+ default :
120
+ return jobs_config ;
121
+ }
122
+ } ) ( ) ;
113
123
114
124
for ( const test of parallelTests ) {
115
125
const running_test = dispatchTest ( test ) . finally ( ( ) => {
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ export interface ExtensionConfiguration {
18
18
setupOptions : string [ ] ;
19
19
testOptions : string [ ] ;
20
20
testEnvironment : { [ key : string ] : string } ;
21
+ testJobs : number ;
21
22
benchmarkOptions : string [ ] ;
22
23
buildFolder : string ;
23
24
mesonPath : string ;
You can’t perform that action at this time.
0 commit comments