NAnt 0.84 (Build
0.84.1455.0; net-1.0.win32; release; 12/26/2003)
I have a standard
csharp test that works fine through the nuni-gui, but seems to be totally
skipped in the build script. I've ensured that the test assembly is referencing
the nant.framework.dll from ..\nant\bin to ensure version compatibility. You'll
notice from the console output segment that the expected [nunit2] lines are
totally missing. There are no errors reported or logged (that i can find).
However, if I remove the <formatter> element, I do get the [nunit2]
console warnings about giving a propert formatter for forward compatibility.
This clues me in that the task is getting fired.
However, there is
just no output and if I modify the test code for force a failure, no failure is
reported from the build script. Again, the same forced failure will be propertly
reported via the gui. What this means is, I can open my test class, select a
test function and add a new line of code to throw an unexpected exception... but
it just doesn't seem to work.
Any help is greatly
appreciated.
Here is the build
script target that builds the little utility and attempts to run it's supporting
tests:
____ TARGET
____
<target
name="build-utilities" depends="initialize" description="builds the utilities
that are required for the build file process">
<solution configuration="${buildType}"
solutionfile="${UtilitiesDir}\Utilities.sln">
<projects>
<includes name="VbGrep\VbGrep.csproj"/>
<includes name="UtilityTests\UtilityTests.csproj"/>
<includes name="SimpleGrep\SimpleGrep.csproj"/>
</projects>
</solution>
<projects>
<includes name="VbGrep\VbGrep.csproj"/>
<includes name="UtilityTests\UtilityTests.csproj"/>
<includes name="SimpleGrep\SimpleGrep.csproj"/>
</projects>
</solution>
<!--
NUNIT2 is not working correctly. It appears to skip the test, even though
everything appears to be correct.-->
<nunit2 verbose="true" haltonfailure="true">
<formatter type="Plain" usefile="true" outputfile="junk"/>
<test assembly="${binTools}\UtilityTests.dll"/>
</nunit2>
<nunit2 verbose="true" haltonfailure="true">
<formatter type="Plain" usefile="true" outputfile="junk"/>
<test assembly="${binTools}\UtilityTests.dll"/>
</nunit2>
</target>
____ENDTARGET___
___CONSOLE_OUTPUT_SEGMENT___
build-utilities:
[solution]
Starting solution build.
[solution] Building SimpleGrep [debug]...
[solution] Building BuildUtilityTests [debug]...
[solution] Building VbGrep [debug]...
[solution] Building SimpleGrep [debug]...
[solution] Building BuildUtilityTests [debug]...
[solution] Building VbGrep [debug]...
success:
___END_CONSOLE_OUTPUT_SEGMENT___
namespace
Utiltites.Tests
{
[TestFixture]
public class SimpleGrepTests
{
private string _fileName = string.Empty;
{
[TestFixture]
public class SimpleGrepTests
{
private string _fileName = string.Empty;
[Test]
public void CreateSimpleGrepBadSearchToken()
{
try
{
SimpleGrep sp = new SimpleGrep(null, "");
}
catch (ArgumentException sge)
{
Console.WriteLine("Expected error type caught: {0}", sge);
}
catch (Exception e)
{
throw new Exception("Unexpected error encountered!", e);
}
}
public void CreateSimpleGrepBadSearchToken()
{
try
{
SimpleGrep sp = new SimpleGrep(null, "");
}
catch (ArgumentException sge)
{
Console.WriteLine("Expected error type caught: {0}", sge);
}
catch (Exception e)
{
throw new Exception("Unexpected error encountered!", e);
}
}
Thanks,
Smith
