Skip to content

Commit 8559149

Browse files
author
Jakob Jungreuthmayer
committed
Disable executing multiple GUI-testcases at once
1 parent 50116dd commit 8559149

File tree

2 files changed

+42
-5
lines changed

2 files changed

+42
-5
lines changed

package.json

+5
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@
8181
"type": "boolean",
8282
"default": true
8383
},
84+
"vunit-by-hgb.execute-multiple-gui-testcases": {
85+
"description": "Executing multiple GUI-Testcases at once",
86+
"type": "boolean",
87+
"default": false
88+
},
8489
"vunit-by-hgb.matchProblems": {
8590
"description": "Display Errors and Warnings from VUnit as Problems",
8691
"type": "boolean",

src/VUnit/VUnitTestController.ts

+37-5
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,29 @@ export class VUnitTestController {
139139
}
140140
//execute selected test-cases in GUI
141141
else if (shouldDebug)
142-
{
143-
await this.RunVUnitTestsGUI(request.include[0], request, run);
142+
{
143+
144+
if (request.include[0].children.size > 0)
145+
{
146+
// read configuration from vscode-settings
147+
const multipleGuiTestcases = vscode.workspace
148+
.getConfiguration()
149+
.get('vunit-by-hgb.execute-multiple-gui-testcases') as boolean;
150+
151+
if (!multipleGuiTestcases)
152+
{
153+
vscode.window.showErrorMessage("Executing multiple testcases in GUI-Mode: disabled!");
154+
}
155+
else
156+
{
157+
await this.RunVUnitTestsGUI(request.include[0], request, run);
158+
}
159+
}
160+
else
161+
{
162+
await this.RunVUnitTestsGUI(request.include[0], request, run);
163+
}
164+
144165
}
145166

146167
}
@@ -166,9 +187,21 @@ export class VUnitTestController {
166187
//execute all test-cases in GUI
167188
else if (shouldDebug)
168189
{
169-
for(const item of TopLevelItems)
190+
// read configuration from vscode-settings
191+
const multipleGuiTestcases = vscode.workspace
192+
.getConfiguration()
193+
.get('vunit-by-hgb.execute-multiple-gui-testcases') as boolean;
194+
195+
if (!multipleGuiTestcases)
170196
{
171-
await this.RunVUnitTestsGUI(item, request, run);
197+
vscode.window.showErrorMessage("Executing all testcases in GUI-Mode: disabled!");
198+
}
199+
else
200+
{
201+
for(const item of TopLevelItems)
202+
{
203+
await this.RunVUnitTestsGUI(item, request, run);
204+
}
172205
}
173206
}
174207
}
@@ -179,7 +212,6 @@ export class VUnitTestController {
179212
public async LoadTests() : Promise<void>
180213
{
181214

182-
183215
//Find all Run.Py-Files in WorkSpace
184216
const RunPyFiles : string[] = await this.mVUnit.FindRunPy((vscode.workspace.workspaceFolders || [])[0]);
185217

0 commit comments

Comments
 (0)