@@ -65,9 +65,9 @@ export class TestDisplay implements ITestDisplay {
65
65
return fn . parentTestFile . name === testFile . name &&
66
66
testFunctions . some ( testFunc => testFunc . nameToRun === fn . testFunction . nameToRun ) ;
67
67
} ) ;
68
-
69
- this . appShell . showQuickPick ( buildItemsForFunctions ( rootDirectory , flattenedFunctions , undefined , undefined , debug ) ,
70
- { matchOnDescription : true , matchOnDetail : true } )
68
+ const runAllItem = buildRunAllParametrizedItem ( flattenedFunctions , debug ) ;
69
+ const functionItems = buildItemsForFunctions ( rootDirectory , flattenedFunctions , undefined , undefined , debug ) ;
70
+ this . appShell . showQuickPick ( runAllItem . concat ( ... functionItems ) , { matchOnDescription : true , matchOnDetail : true } )
71
71
. then ( testItem => testItem ? onItemSelected ( this . commandManager , cmdSource , wkspace , testItem , debug ) : Promise . resolve ( ) ) ;
72
72
}
73
73
}
@@ -84,7 +84,8 @@ export enum Type {
84
84
Null = 8 ,
85
85
SelectAndRunMethod = 9 ,
86
86
DebugMethod = 10 ,
87
- Configure = 11
87
+ Configure = 11 ,
88
+ RunParametrized = 12
88
89
}
89
90
const statusIconMapping = new Map < TestStatus , string > ( ) ;
90
91
statusIconMapping . set ( TestStatus . Pass , constants . Octicons . Test_Pass ) ;
@@ -95,6 +96,7 @@ statusIconMapping.set(TestStatus.Skipped, constants.Octicons.Test_Skip);
95
96
type TestItem = QuickPickItem & {
96
97
type : Type ;
97
98
fn ?: FlattenedTestFunction ;
99
+ fns ?: TestFunction [ ] ;
98
100
} ;
99
101
100
102
type TestFileItem = QuickPickItem & {
@@ -150,6 +152,18 @@ const statusSortPrefix = {
150
152
[ TestStatus . Unknown ] : undefined
151
153
} ;
152
154
155
+ function buildRunAllParametrizedItem ( tests : FlattenedTestFunction [ ] , debug : boolean = false ) : TestItem [ ] {
156
+ const testFunctions : TestFunction [ ] = [ ] ;
157
+ tests . forEach ( fn => {
158
+ testFunctions . push ( fn . testFunction ) ;
159
+ } ) ;
160
+ return [ {
161
+ description : '' ,
162
+ label : debug ? 'Debug All' : 'Run All' ,
163
+ type : Type . RunParametrized ,
164
+ fns : testFunctions
165
+ } ] ;
166
+ }
153
167
function buildItemsForFunctions ( rootDirectory : string , tests : FlattenedTestFunction [ ] , sortBasedOnResults : boolean = false , displayStatusIcons : boolean = false , debug : boolean = false ) : TestItem [ ] {
154
168
const functionItems : TestItem [ ] = [ ] ;
155
169
tests . forEach ( fn => {
@@ -218,6 +232,9 @@ export function onItemSelected(commandManager: ICommandManager, cmdSource: Comma
218
232
case Type . RunAll : {
219
233
return commandManager . executeCommand ( constants . Commands . Tests_Run , undefined , cmdSource , wkspace , undefined ) ;
220
234
}
235
+ case Type . RunParametrized : {
236
+ return commandManager . executeCommand ( constants . Commands . Tests_Run_Parametrized , undefined , cmdSource , wkspace , selection . fns ! , debug ! ) ;
237
+ }
221
238
case Type . ReDiscover : {
222
239
return commandManager . executeCommand ( constants . Commands . Tests_Discover , undefined , cmdSource , wkspace ) ;
223
240
}
0 commit comments