The class FinallyDelegate was added in changeset
88c3edc80c
This patch ensures that the class will be built with MSBuild under
NUnitLite, for frameworks 2.0, 3.5, 4.0, and 4.5
* src/**/*.csproj: Use AppendConstants within DefineConstants declations
This patch provides support for an AppendContants build parameter, in
NUnitLite under MSBuild. This allows for building with such as the
following build options, under Mono:
~~~~
msbuild src/framework/nunitlite-4.5.csproj \
/p:AppendConstants=MONO \
/restore /t:build /p:CscToolPath=${PREFIX}/lib/mono/4.5/ \
/p:TargetFrameworkVersion=4.7.2 /p:SignAssembly=false /v:detailed
~~~~
To some extent, this may serve to emulate some of the build
configuration under NAnt.
* TextUI.cs: Patch for Mono environments absent of nunit24, xunit
This patch extends on a patch published in an earlier branch, available
via contrib under the branch ci/patch-append-constants in changeset 9d3568e
Concerning nunit24 support for Mono in NUnitLite, the nunit24 BabySitter
class was removed from the Mono mcs source tree, in Mono 6.6.0.161
55fbd14763
Concering xunit support for Mono in NUnitLite, the mono xunit-binaries
external may not be available under some Mono installations.
This changeset applies a couple of additional preprocessor declarations
in NUnitLite TextUI.cs, such that may serve to allow for building in a
Mono environment without nunit24 support and/or without xunit support,
vis a vis
MONO_NO_NUNIT24
MONO_NO_XUNIT
This may be applied with such as the following msbuild cmd - noting the
particular syntax for providing a sequence of constant symbols in
AppendConstants, namely double quoting the value as delimited with comma
characters, such that may be supported in UNIX-like shell environments:
~~~~
msbuild src/framework/nunitlite-4.5.csproj /restore /t:build \
/p:CscToolPath=/usr/pkg/lib/mono/4.5/ /p:SignAssembly=false /v:detailed \
/p:RunCodeAnalysis=false /p:TargetFrameworkVersion=4.7.2 \
/p:AppendConstants=\"MONO,MONO_NO_NUNIT24,MONO_NO_XUNIT\"
~~~~
This may serve to prevent a build failure, such that may otherwise occur
while compiling TextUI.cs when the MONO symbol is declared in the
compiler environment.
For Mono environments in which the xunit assemblies may be available,
of course the MONO_NO_XUNIT symbol may be removed from the declaration
of the AppendConstants property. The similar would apply, repectively,
for any Mono environment in which the original nunit24 support may be
available.
For purposes of ensuring backwards compatibility, by default, the build
under MONO would be produced as in the original behavior, i.e assuming
nunit24 and xunit would both be available in the build environment.
This patch provides support for an AppendContants build parameter, in
NUnitLite under MSBuild. This allows for building with such as the
following build options, under Mono:
~~~~
msbuild src/framework/nunitlite-4.5.csproj \
/p:AppendConstants=MONO \
/restore /t:build /p:CscToolPath=${PREFIX}/lib/mono/4.5/ \
/p:TargetFrameworkVersion=4.7.2 /p:SignAssembly=false /v:detailed
~~~~
To some extent, this may serve to emulate some of the build
configuration under NAnt.
This patch may serve to work around a matter of the availability of
the file `AllRules.ruleset`, such that may not exist under some MSBUild
installations, This workaround, as such, may be applied in a manner as
follows, namely in disabling the RunCodeAnalysis property when building
NUnitLite under MSBuild.
~~~~
msbuild NUnitLite-1.0.0/src/framework/nunitlite-4.5.csproj /p:RunCodeAnalysis=false
~~~~
This may serve to prevent a number of warning messages, when building
NUnitLite under MSBuild with some Mono installations.
This patch provides, in effect, a conditional evaluation for the
declaration of the CodeAnalysisRuleSet property in NUnitLite *.csproj
files.
The old code does not work with very large files and results in an
exception similar to the following one when running the BCL test on
xamarin-macios
```
System.IndexOutOfRangeException: Index was outside the bounds of the array.
at System.Xml.XmlEncodedRawTextWriter.WriteChars (System.Char[] buffer, System.Int32 index, System.Int32 count) [0x00017] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlEncodedRawTextWriter.cs:616
at System.Xml.XmlEncodedRawTextWriterIndent.WriteChars (System.Char[] buffer, System.Int32 index, System.Int32 count) [0x00007] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlEncodedRawTextWriter.cs:1796
at System.Xml.XmlWellFormedWriter.WriteChars (System.Char[] buffer, System.Int32 index, System.Int32 count) [0x00078] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlWellFormedWriter.cs:960
at NUnit.Framework.Api.XmlNode.WriteTo (System.Xml.XmlWriter writer) [0x0005b] in /Users/mandel/Xamarin/xamarin-macios/master/xamarin-macios/builds/downloads/ios-release-Darwin-2edccc52a78d90fea7bcbd37844164663e712397/ios-sources/external/nunit-lite/NUnitLite-1.0.0/src/framework/Api/XmlNode.cs:203
at NUnit.Framework.Api.XmlNode.WriteTo (System.Xml.XmlWriter writer) [0x0008d] in /Users/mandel/Xamarin/xamarin-macios/master/xamarin-macios/builds/downloads/ios-release-Darwin-2edccc52a78d90fea7bcbd37844164663e712397/ios-sources/external/nunit-lite/NUnitLite-1.0.0/src/framework/Api/XmlNode.cs:206
at NUnit.Framework.Api.XmlNode.WriteTo (System.Xml.XmlWriter writer) [0x0008d] in /Users/mandel/Xamarin/xamarin-macios/master/xamarin-macios/builds/downloads/ios-release-Darwin-2edccc52a78d90fea7bcbd37844164663e712397/ios-sources/external/nunit-lite/NUnitLite-1.0.0/src/framework/Api/XmlNode.cs:206
at NUnit.Framework.Api.XmlNode.WriteTo (System.Xml.XmlWriter writer) [0x0008d] in /Users/mandel/Xamarin/xamarin-macios/master/xamarin-macios/builds/downloads/ios-release-Darwin-2edccc52a78d90fea7bcbd37844164663e712397/ios-sources/external/nunit-lite/NUnitLite-1.0.0/src/framework/Api/XmlNode.cs:206
at NUnit.Framework.Api.XmlNode.WriteTo (System.Xml.XmlWriter writer) [0x0008d] in /Users/mandel/Xamarin/xamarin-macios/master/xamarin-macios/builds/downloads/ios-release-Darwin-2edccc52a78d90fea7bcbd37844164663e712397/ios-sources/external/nunit-lite/NUnitLite-1.0.0/src/framework/Api/XmlNode.cs:206
at NUnit.Framework.Api.XmlNode.WriteTo (System.Xml.XmlWriter writer) [0x0008d] in /Users/mandel/Xamarin/xamarin-macios/master/xamarin-macios/builds/downloads/ios-release-Darwin-2edccc52a78d90fea7bcbd37844164663e712397/ios-sources/external/nunit-lite/NUnitLite-1.0.0/src/framework/Api/XmlNode.cs:206
at NUnitLite.Runner.NUnit3XmlOutputWriter.WriteXmlOutput (NUnit.Framework.Api.ITestResult result, System.Xml.XmlWriter xmlWriter) [0x0000e] in /Users/mandel/Xamarin/xamarin-macios/master/xamarin-macios/builds/downloads/ios-release-Darwin-2edccc52a78d90fea7bcbd37844164663e712397/ios-sources/external/nunit-lite/NUnitLite-1.0.0/src/framework/Runner/OutputWriters/NUnit3XmlOutputWriter.cs:80
at NUnitLite.Runner.NUnit3XmlOutputWriter.WriteResultFile (NUnit.Framework.Api.ITestResult result, System.IO.TextWriter writer) [0x00015] in /Users/mandel/Xamarin/xamarin-macios/master/xamarin-macios/builds/downloads/ios-release-Darwin-2edccc52a78d90fea7bcbd37844164663e712397/ios-sources/external/nunit-lite/NUnitLite-1.0.0/src/framework/Runner/OutputWriters/NUnit3XmlOutputWriter.cs:66
at MonoTouch.NUnit.NUnitOutputTextWriter.Close () [0x000bc] in /Users/mandel/Xamarin/xamarin-macios/master/xamarin-macios/external/Touch.Unit/NUnitLite/TouchRunner/NUnitOutputTextWriter.cs:99
at MonoTouch.NUnit.UI.BaseTouchRunner.CloseWriter () [0x0006c] in /Users/mandel/Xamarin/xamarin-macios/master/xamarin-macios/external/Touch.Unit/NUnitLite/TouchRunner/TouchRunner.cs:366
```
The new implementation has no issues with large resultsi, as an example
it was used to generate: https://gist.github.com/mandel-macaque/57d61ce2251796682d7cda7fb9dca4f7
The new version of the Jenkins xunit xml parsing plugin doesn't like it:
```
WARNING: At line 7 of file:/mnt/jenkins/workspace/test-mono-pull-request-amd64/mcs/class/Commons.Xml.Relaxng/TestResult-net_4_x.xml:cvc-complex-type.2.4.b:
The content of element 'categories' is not complete. One of '{category}' is expected.
```
Attributes like `[TestCase]` execute the same test method multiple
times, therefore there could be a clash in `lookupTable` when adding
more elements to it.
Use GUID in order to make key for `lookupTable` without doubt unique
Whenever a test fails we retry it five times and then decide the
overall result based on that. If three or more of the five retries
fail too then the overall result is FAIL, two or lower means PASS.