File tree Expand file tree Collapse file tree 5 files changed +43
-10
lines changed Expand file tree Collapse file tree 5 files changed +43
-10
lines changed Original file line number Diff line number Diff line change 1
1
import * as vscode from 'vscode' ;
2
2
import { AbstractTest } from './framework/AbstractTest' ;
3
3
import { parseLine } from './Util' ;
4
+ import { AbstractExecutable } from './framework/AbstractExecutable' ;
4
5
5
6
///
6
7
@@ -110,4 +111,15 @@ export class TestItemManager {
110
111
}
111
112
}
112
113
}
114
+
115
+ // maps only if the TestItem explicitly represents the executable. relates to groupByExecuable
116
+ private readonly testItem2ExecDirectly = new WeakMap < vscode . TestItem , AbstractExecutable > ( ) ;
117
+
118
+ setDirectExec ( item : vscode . TestItem , exec : AbstractExecutable ) : void {
119
+ this . testItem2ExecDirectly . set ( item , exec ) ;
120
+ }
121
+
122
+ getDirectExec ( item : vscode . TestItem ) : AbstractExecutable | undefined {
123
+ return this . testItem2ExecDirectly . get ( item ) ;
124
+ }
113
125
}
Original file line number Diff line number Diff line change @@ -328,6 +328,7 @@ export abstract class AbstractExecutable<TestT extends AbstractTest = AbstractTe
328
328
329
329
// special item handling for exec
330
330
this . _execItem . setItem ( itemOfLevel ) ;
331
+ this . shared . testController . setDirectExec ( itemOfLevel , this ) ;
331
332
} ,
332
333
groupBySource : async ( g : GroupBySource ) : Promise < void > => {
333
334
this . _updateVarsWithTags ( g , tags , tagsResolveRule ) ;
@@ -630,7 +631,7 @@ export abstract class AbstractExecutable<TestT extends AbstractTest = AbstractTe
630
631
} else testsToRunFinal . push ( t ) ;
631
632
}
632
633
633
- if ( testsToRunFinal . length == 0 ) return ;
634
+ if ( testsToRunFinal . length == 0 && ! testsToRun . implicitAll ) return ;
634
635
635
636
try {
636
637
await this . runTasks ( 'beforeEach' , taskPool , testRun . token ) ;
@@ -1014,6 +1015,7 @@ class ExecutableGroup {
1014
1015
export class TestsToRun {
1015
1016
readonly direct : AbstractTest [ ] = [ ] ; // test is drectly included, should be run even if it is skipped
1016
1017
readonly parent : AbstractTest [ ] = [ ] ; // tests included because one of the ascendant was directly included
1018
+ implicitAll : boolean = false ;
1017
1019
1018
1020
* [ Symbol . iterator ] ( ) : Iterator < AbstractTest > {
1019
1021
for ( const i of this . direct ) yield i ;
Original file line number Diff line number Diff line change @@ -65,6 +65,10 @@ export class SharedVarOfExec {
65
65
return this . _frameworkSpecific . failIfExceedsLimitNs ;
66
66
}
67
67
68
+ get enableRunExecutableTestsImplicitly ( ) : boolean {
69
+ return true ; //TODO
70
+ }
71
+
68
72
/// accessors for shared
69
73
70
74
readonly log = this . shared . log ;
Original file line number Diff line number Diff line change @@ -103,6 +103,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<void>
103
103
if ( request . exclude ?. includes ( item ) ) return ;
104
104
105
105
const test = testItemManager . map ( item ) ;
106
+ const directExec = test ? undefined : testItemManager . getDirectExec ( item ) ;
106
107
107
108
if ( test ) {
108
109
const executable = test . exec ;
@@ -118,6 +119,20 @@ export async function activate(context: vscode.ExtensionContext): Promise<void>
118
119
executables . set ( executable , tests ) ;
119
120
}
120
121
tests [ type ] . push ( test ) ;
122
+ } else if ( directExec && directExec . shared . enableRunExecutableTestsImplicitly ) {
123
+ const executable = directExec ;
124
+ const manager = workspace2manager . get ( executable . shared . workspaceFolder ) ! ;
125
+ let executables = managers . get ( manager ) ;
126
+ if ( ! executables ) {
127
+ executables = new Map < AbstractExecutable , TestsToRun > ( ) ;
128
+ managers . set ( manager , executables ) ;
129
+ }
130
+ let tests = executables . get ( executable ) ;
131
+ if ( ! tests ) {
132
+ tests = new TestsToRun ( ) ;
133
+ executables . set ( executable , tests ) ;
134
+ }
135
+ tests . implicitAll = true ;
121
136
} else if ( item . children . size ) {
122
137
item . children . forEach ( enumerator ( 'parent' ) ) ;
123
138
}
Original file line number Diff line number Diff line change 26
26
// },
27
27
// },
28
28
// },
29
- // {
30
- // "pattern": "build/*.exe",
31
- // // "testGrouping": {
32
- // // "groupByExecutable": {
33
- // // "groupBySplittedTestName": {
34
- // // },
35
- // // },
36
- // // },
37
- // }
29
+ {
30
+ "pattern" : " build/*.exe" ,
31
+ // "testGrouping": {
32
+ // "groupByExecutable": {
33
+ // "groupBySplittedTestName": {
34
+ // },
35
+ // },
36
+ // },
37
+ }
38
38
],
39
39
"files.exclude" : {
40
40
"**/sub/**" : false ,
You can’t perform that action at this time.
0 commit comments