Skip to content

Commit 339f349

Browse files
committed
Added Run and Run with Coverage buttons to TestResultWindow
1 parent 70fea3c commit 339f349

File tree

2 files changed

+84
-24
lines changed

2 files changed

+84
-24
lines changed

PlsqlDeveloperUtPlsqlPlugin/utPLSQL.UI/TestRunnerWindow.Designer.cs

Lines changed: 58 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

PlsqlDeveloperUtPlsqlPlugin/utPLSQL.UI/TestRunnerWindow.cs

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,7 @@ private void CreateDataSourceAndConfigureGridColumns()
6767

6868
public async Task RunTestsAsync(string type, string owner, string name, string procedure, bool coverage)
6969
{
70-
ResetComponents();
71-
72-
testResults.Clear();
73-
74-
SetWindowTitle(type, owner, name, procedure);
70+
var path = GetPath(type, owner, name, procedure);
7571

7672
testRunner = new RealTimeTestRunner();
7773

@@ -98,11 +94,22 @@ public async Task RunTestsAsync(string type, string owner, string name, string p
9894
return;
9995
}
10096

97+
await RunTestsAsync(path, coverage);
98+
}
99+
100+
private async Task RunTestsAsync(List<string> path, bool coverage)
101+
{
102+
ResetComponents();
103+
104+
testResults.Clear();
105+
106+
SetWindowTitle(path);
107+
101108
Running = true;
102109

103110
if (coverage)
104111
{
105-
var codeCoverageReportDialog = new CodeCoverageReportDialog(GetPath(type, owner, name, procedure));
112+
var codeCoverageReportDialog = new CodeCoverageReportDialog(path);
106113
var dialogResult = codeCoverageReportDialog.ShowDialog();
107114
if (dialogResult == DialogResult.OK)
108115
{
@@ -116,7 +123,7 @@ public async Task RunTestsAsync(string type, string owner, string name, string p
116123

117124
txtStatus.Text = "Running tests with coverage...";
118125

119-
var htmlReport = await testRunner.RunTestsWithCoverageAsync(GetPath(type, owner, name, procedure), CollectResults(coverage), schemas, includes, excludes);
126+
var htmlReport = await testRunner.RunTestsWithCoverageAsync(path, CollectResults(coverage), schemas, includes, excludes);
120127

121128
var filePath = $"{Path.GetTempPath()}\\utPLSQL_Coverage_Report_{Guid.NewGuid()}.html";
122129
using (var sw = new StreamWriter(filePath))
@@ -144,7 +151,7 @@ public async Task RunTestsAsync(string type, string owner, string name, string p
144151

145152
txtStatus.Text = "Running tests...";
146153

147-
await testRunner.RunTestsAsync(GetPath(type, owner, name, procedure), CollectResults(coverage));
154+
await testRunner.RunTestsAsync(path, CollectResults(coverage));
148155
}
149156
}
150157

@@ -278,11 +285,10 @@ private void UpdateProgressBar()
278285
}
279286
}
280287

281-
private void SetWindowTitle(string type, string owner, string name, string procedure)
288+
private void SetWindowTitle(List<string> path)
282289
{
283290
var startTime = DateTime.Now.ToString(CultureInfo.CurrentCulture);
284291
txtStart.Text = startTime;
285-
var path = GetPath(type, owner, name, procedure);
286292
txtPath.Text = path[0];
287293
Text = $"{path[0]} {startTime}";
288294
}
@@ -644,5 +650,15 @@ private void cbDisabled_CheckedChanged(object sender, EventArgs e)
644650
{
645651
FilterTestResults();
646652
}
653+
654+
private async void btnRun_Click(object sender, EventArgs e)
655+
{
656+
await RunTestsAsync(new List<string> { txtPath.Text }, false);
657+
}
658+
659+
private async void button1_Click(object sender, EventArgs e)
660+
{
661+
await RunTestsAsync(new List<string> { txtPath.Text }, true);
662+
}
647663
}
648664
}

0 commit comments

Comments
 (0)