Trap incorrect input for nunit-console.exe options.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
NUnit V2 |
Fix Released
|
Medium
|
Simone Busoli |
Bug Description
nunit-console.exe should handle incorrect options gracefully. As of now, it either runs 0 tests or throws an unhandled exception.
1) Specifically, for the /runlist option, the following is thrown:
/cygdrive/
NUnit-Console version 2.6.1.12217
Copyright (C) 2002-2012 Charlie Poole.
Copyright (C) 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov.
Copyright (C) 2000-2002 Philip Craig.
All Rights Reserved.
Runtime Environment -
OS Version: Microsoft Windows NT 5.1.2600 Service Pack 3
CLR Version: 2.0.50727.3634 ( Net 3.5 )
ProcessModel: Default DomainUsage: Single
Execution Runtime: net-3.5
Run list: ./EmptyLibrary/
Unhandled Exception:
System.
at NUnit.ConsoleRu
at NUnit.ConsoleRu
2) If /runlist path is incorrect, than 0 tests are run. This is a silent error that should also be handled by notifying users that no such path exists.
Related branches
- Charlie Poole: Approve
-
Diff: 615 lines (+299/-224)7 files modifiedsrc/ConsoleRunner/nunit-console-exe/nunit-console.exe.build (+1/-1)
src/ConsoleRunner/nunit-console/ConsoleUi.cs (+91/-63)
src/ConsoleRunner/tests/ConsoleRunnerTest.cs (+35/-1)
src/ConsoleRunner/tests/EmptyLineTextFile.txt (+1/-0)
src/ConsoleRunner/tests/EmptyTextFile.txt (+1/-0)
src/ConsoleRunner/tests/nunit-console.tests.build (+4/-1)
src/ConsoleRunner/tests/nunit-console.tests.csproj (+166/-158)
Changed in nunitv2: | |
status: | New → Triaged |
importance: | Undecided → Medium |
Changed in nunitv2: | |
milestone: | none → 2.6.2 |
Changed in nunitv2: | |
assignee: | nobody → Simone Busoli (simone.busoli) |
Changed in nunitv2: | |
status: | Triaged → Fix Committed |
Changed in nunitv2: | |
status: | Fix Committed → Fix Released |
Simone, This fix is causing a problem in the final release package, when NUnit is installed in the Program Files directory. We can't access the two text files you added due to security concerns. The best solution I've found in similar cases is to create the files on the fly in the temp directory and delete them afterwards. That would be best, if you have time. Otherwise, we can just drop those tests from the release.
Charlie