Skip to content

Commit 7aaa25b

Browse files
committed
Added code coverage to user and package
1 parent bd91e3f commit 7aaa25b

File tree

4 files changed

+35
-2
lines changed

4 files changed

+35
-2
lines changed

PlsqlDeveloperUtPlsqlPlugin/PlsqlDeveloperUtPlsqlPlugin/CodeCoverateReportDialog.Designer.cs

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

PlsqlDeveloperUtPlsqlPlugin/PlsqlDeveloperUtPlsqlPlugin/CodeCoverateReportDialog.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,13 @@ public string GetExcludes()
2525
{
2626
return txtExluces.Text;
2727
}
28+
29+
private void keyDown(object sender, KeyEventArgs e)
30+
{
31+
if (e.KeyCode == Keys.Enter)
32+
{
33+
btnRun.PerformClick();
34+
}
35+
}
2836
}
2937
}

PlsqlDeveloperUtPlsqlPlugin/PlsqlDeveloperUtPlsqlPlugin/PlsqlDeveloperUtPlsqlPlugin.cs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public class PlsqlDeveloperUtPlsqlPlugin
3232
private const int PLUGIN_MENU_INDEX_ALLTESTS = 3;
3333
private const int PLUGIN_MENU_INDEX_ALLTESTS_WITH_COVERAGE = 4;
3434
private const int PLUGIN_POPUP_INDEX = 1;
35+
private const int PLUGIN_POPUP_INDEX_WITH_COVERAGE = 2;
3536

3637
private static PlsqlDeveloperUtPlsqlPlugin plugin;
3738

@@ -92,14 +93,21 @@ public static void OnActivate()
9293
{
9394
PlsqlDeveloperUtPlsqlPlugin.createToolButton(pluginId, PLUGIN_POPUP_INDEX, "utPLSQL", "utPLSQL.bmp", new Bitmap(stream).GetHbitmap().ToInt64());
9495
}
96+
using (Stream stream = assembly.GetManifestResourceStream("utPLSQL.utPLSQL.bmp"))
97+
{
98+
PlsqlDeveloperUtPlsqlPlugin.createToolButton(pluginId, PLUGIN_POPUP_INDEX_WITH_COVERAGE, "utPLSQL", "utPLSQL.bmp", new Bitmap(stream).GetHbitmap().ToInt64());
99+
}
95100
}
96101
catch (Exception e)
97102
{
98103
MessageBox.Show(e.Message);
99104
}
100105

101106
PlsqlDeveloperUtPlsqlPlugin.createPopupItem(pluginId, PLUGIN_POPUP_INDEX, "Run utPLSQL Test", "USER");
107+
PlsqlDeveloperUtPlsqlPlugin.createPopupItem(pluginId, PLUGIN_POPUP_INDEX_WITH_COVERAGE, "Run Code Coverage", "USER");
108+
102109
PlsqlDeveloperUtPlsqlPlugin.createPopupItem(pluginId, PLUGIN_POPUP_INDEX, "Run utPLSQL Test", "PACKAGE");
110+
PlsqlDeveloperUtPlsqlPlugin.createPopupItem(pluginId, PLUGIN_POPUP_INDEX_WITH_COVERAGE, "Run Code Coverage", "PACKAGE");
103111
}
104112

105113
[DllExport("CanClose", CallingConvention = CallingConvention.Cdecl)]
@@ -212,6 +220,21 @@ public static void OnMenuClick(int index)
212220
testResultWindow.RunTestsAsync(Marshal.PtrToStringAnsi(type), Marshal.PtrToStringAnsi(owner), Marshal.PtrToStringAnsi(name), Marshal.PtrToStringAnsi(subType), false);
213221
}
214222
}
223+
else if (index == PLUGIN_POPUP_INDEX_WITH_COVERAGE)
224+
{
225+
if (PlsqlDeveloperUtPlsqlPlugin.connected())
226+
{
227+
IntPtr type;
228+
IntPtr owner;
229+
IntPtr name;
230+
IntPtr subType;
231+
PlsqlDeveloperUtPlsqlPlugin.getPopupObject(out type, out owner, out name, out subType);
232+
233+
var testResultWindow = new TestRunnerWindow(testRunner);
234+
windows.Add(testResultWindow);
235+
testResultWindow.RunTestsAsync(Marshal.PtrToStringAnsi(type), Marshal.PtrToStringAnsi(owner), Marshal.PtrToStringAnsi(name), Marshal.PtrToStringAnsi(subType), true);
236+
}
237+
}
215238
}
216239

217240
[DllExport("About", CallingConvention = CallingConvention.Cdecl)]

PlsqlDeveloperUtPlsqlPlugin/PlsqlDeveloperUtPlsqlPlugin/TestRunnerWindow.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,4 +513,3 @@ private void menuItemRunTests_Click(object sender, EventArgs e)
513513
}
514514
}
515515
}
516-

0 commit comments

Comments
 (0)