Gui enables run when the assembly specified on the command line is not found

Bug #907270 reported by MichiGreat
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
NUnit V2
Fix Released
High
Charlie Poole

Bug Description

Belongs to: NUnit 2.5.10

If you start nunit for example like this:
nunit.exe /run x:\doesnt_exists
and then click the "Run" button (which is enabled after the error message that states that the file could not be loaded), an exception is thrown:

System.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
bei NUnit.Util.TestLoader.RunTests(ITestFilter filter)

It seems that the error is in file TestLoader.cs in line 618: Perhaps Services or Services.UserSettings is null. All other calls in RunTests(ITestFilter) don't look suspicious to me to raise that exception or would cause to happen the exception in a different place (like if filter was null - exception would be thrown somewhere in BeginRun or afterwards).

Full strack trace:

System.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
bei NUnit.Util.TestLoader.RunTests(ITestFilter filter)
bei NUnit.UiKit.TestSuiteTreeView.RunTests(ITest[] tests, Boolean ignoreCategories)
bei NUnit.UiKit.TestSuiteTreeView.RunSelectedTests()
bei NUnit.UiKit.TestTree.RunSelectedTests()
bei NUnit.Gui.NUnitForm.runButton_Click(Object sender, EventArgs e)
bei System.Windows.Forms.Control.OnClick(EventArgs e)
bei System.Windows.Forms.Button.OnClick(EventArgs e)
bei System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
bei System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
bei System.Windows.Forms.Control.WndProc(Message& m)
bei System.Windows.Forms.ButtonBase.WndProc(Message& m)
bei System.Windows.Forms.Button.WndProc(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Related branches

Revision history for this message
Charlie Poole (charlie.poole) wrote :

Strangely, I get the error but with a different stacktrace. In addition, the menu items Run All and Run Selected are also enabled and (naturally) cause a failure as well. This occurs with or without the user of the /run option. I'm changing the description, since the main problem is that these UI elements should not be enabled at all.

summary: - Clicking run button causes exception if no test loaded
+ Gui enables run when the assembly specified on the command line is not
+ found
Changed in nunitv2:
status: New → Triaged
importance: Undecided → High
assignee: nobody → Charlie Poole (charlie.poole)
milestone: none → 2.6.0
Changed in nunitv2:
status: Triaged → Fix Committed
Changed in nunitv2:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.