Граф коммитов

54 Коммитов

Автор SHA1 Сообщение Дата
Alexander Köplinger a977ca5757
Don't retry Inconclusive tests in FlakyTestRetriesCommand (#26)
We saw test retries for the `ThreadPoolTests.GetAvailableThreads` test but that test intentionally returns Inconclusive:
db7c5aa72e/mcs/class/corlib/Test/System.Threading/ThreadPoolTest.cs (L184-L189)
2020-03-24 11:13:04 +01:00
Sean Champ 26dbdb9a88
src/framework: Build FinallyDelegate (#21)
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
2020-02-06 12:12:53 +01:00
Sean Champ 7e489745d3
TextUI.cs: Patch for Mono environments absent of nunit24, xunit (#24)
* 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.
2020-02-06 12:12:19 +01:00
Sean Champ e0e6a5948c
src/**/*.csproj: Use AppendConstants within DefineConstants declations (#23)
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.
2020-02-06 11:55:47 +01:00
Sean Champ 065bfc5784
src/**/*.csproj: Define CodeAnalysisRuleSet conditionally (#22)
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.
2020-02-06 11:50:41 +01:00
Manuel de la Pena 7eb477fb0d
[OutputWriter] Fix the NUnit V3 output writer. (#25)
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
2020-02-06 11:49:24 +01:00
Ludovic Henry 5406f2a7a0
Add support for running remote tests on Android device (3rd attempt) (#20) 2019-02-28 22:35:53 -05:00
Ludovic Henry 9f7640d646
Add support for running remote tests on Android device (#19) 2019-02-27 16:57:14 -05:00
Ludovic Henry 7d91da14e7 Add support for running remote tests on Android device (#18) 2019-02-27 22:24:03 +01:00
Ludovic Henry 165a4866a8
Add support for running on Android device (#17)
This allows to run `nunit-console` on the host, and get the tests to run on an attached Android emulator or device.
2019-02-25 22:09:55 -05:00
Alexander Köplinger 0029561453 Fix "Unreachable code" warning 2018-11-26 17:24:27 +01:00
Alexander Köplinger 750febf12f Add WASM to ifdef checks
It recently got changed to throw errors on the Thread methods too.
2018-10-31 17:34:12 +01:00
Alexander Köplinger cff3321322 Add MONOTOUCH_TV and MONOTOUCH_WATCH to ifdef checks
So we don't need to rely on __TVOS__ and __WATCHOS__ which aren't defined in Mono.
2018-10-17 15:43:27 +02:00
Zoltan Varga a55a71bb19
Merge pull request #15 from vargaz/no-calling-assembly
Avoid calling Assembly.GetCallingAssembly () if possible, its not supported by webassembly.
2018-10-07 03:06:08 +02:00
Zoltan Varga 7e86599f0d Make Test:CompareTo () use a faster ordinal compare. 2018-10-01 21:22:17 +02:00
Zoltan Varga 51490023a2 Avoid calling Assembly.GetCallingAssembly () if possible, its not supported by webassembly. 2018-09-29 14:52:41 +02:00
Alexander Köplinger e64e0197a8
Add xUnit xml output format (#14) 2018-09-24 23:33:44 +02:00
Alexander Kyte db5b75b645 [runtime] Add unhandled exception serializer (#13) 2018-09-10 15:56:57 -04:00
Alexander Köplinger 00e259a4bd
Don't emit empty <categories/> element in NUnit2XmlOutputWriter (#12)
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.
```
2018-08-20 12:55:24 +02:00
Alexander Köplinger 808b039ea8
Return Failure=true when FileNotFoundException happens (#11)
Otherwise we'd return no failure when e.g. the requested test assembly
wasn't found.
2018-08-09 14:11:58 +02:00
Bernhard Urban 70bb70b0ff
[FinallyDelegate] rely on PlatformNotSupportedException in order to determine remoting support (#10) 2018-02-26 16:47:11 +01:00
Bernhard Urban 09ad9cf1ea [FinallyDelegate] add comments for why CallContext is used (#9) 2018-02-26 14:21:50 +01:00
Rolf Bjarne Kvinge ab5cc9ca3d
[FinallyDelegate] Make this work with platforms without remoting. (#8) 2018-02-26 13:53:57 +01:00
Bernhard Urban b7776829bb [FinallyDelegate] only call it if available, on some platforms (e.g. iOS) it can be set to null (#7) 2018-02-19 17:10:16 +01:00
Bernhard Urban 0dc7716771 [FinallyDelegate] make key for `lookupTable` actually unique (#6)
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
2018-02-13 00:17:43 +01:00
Bernhard Urban a8bef89392 make FinallyDelegate more resilient regarding unhandled exceptions (#5) 2017-11-14 12:27:54 +01:00
Alexander Köplinger 764656cdaf Retry flaky tests based on an env variable
So we can switch it on/off.
2017-09-01 20:18:56 +02:00
Alexander Köplinger 9bce294b42 Add retrying of failed tests by default to reduce flaky tests
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.
2017-09-01 20:18:56 +02:00
Ludovic Henry 3df9a76221 Merge pull request #4 from luhenry/master
Make -test have the same behavior as with nunit
2017-02-28 11:43:37 -05:00
Marek Safar 690603bea9 Install UnhandledException right before running the tests. We don't want general crashes to go via test failures/crashes handler 2017-01-06 17:36:50 +01:00
Ludovic Henry 230d40c421 Make -test have the same behavior as with nunit 2016-12-14 10:50:28 -05:00
Alexander Köplinger 670081afaf Make sure summary is on new line and add "F" when test fails for dot-progress 2016-11-08 21:23:47 +01:00
Alexander Köplinger dda48cd034 Add back "dot-per-test" progress indicator on Mono
Also write full test name when verbose mode is enabled,
to make it easier to see which fixture a test is in.
2016-11-02 15:12:36 +01:00
Alexander Köplinger da8659f138 Turn off "Tests Not Run" message in Mono
Similar to what we did to nunit24 in d9c3e861fd
2016-10-29 02:25:52 +02:00
Alexander Köplinger d5f08137cc Port the babysitter integration from nunit24 to nunitlite
From 1dc0598bad
2016-10-29 02:25:08 +02:00
Alexander Kyte 8ce8c4ecb7 [runtime] Only count explicit Failure as a failure for the run 2016-08-10 16:23:55 -04:00
Alexander Kyte e4c2696aa3 [runtime] Make top-level test result status available to TextUI consumers. 2016-08-09 14:38:14 -04:00
Alexander Kyte e43146d99e [mobile_static] Added in missing Assertion libraries
These came right from nunit24, added to enable the many tests
which use them to run.
2016-05-24 18:11:36 -04:00
Rolf Bjarne Kvinge 7065bc89e8 Fix compiler warning. 2016-05-12 12:30:28 +02:00
Alexander Kyte 5a80e74622 Use stack of post-test callbacks to run in order to handle unhandled exceptions 2016-01-13 18:51:27 -05:00
Alexander Kyte 88c3edc80c Add the FinallyDelegate class. This ensures that when there are
unhandled exceptions that the test-failure bookkeeping can run.
2016-01-13 18:51:26 -05:00
Alexander Kyte daa5838cbe Changed default assembly loading to be by file, with by name fallback. This is consistent with nunit24 now. 2016-01-13 18:51:26 -05:00
Alexander Kyte 1611627102 Add support for the IsInstanceOfType helper 2016-01-13 18:51:26 -05:00
Sebastien Pouliot 3b9a07faba Don't include the DllImport for GetVersionEx when __MOBILE__ is defined 2015-11-27 10:18:41 -05:00
Rolf Bjarne Kvinge 0970864f49 Thread.[Reset]Abort is not available for tvOS/watchOS. 2015-11-18 17:15:23 +01:00
Rolf Bjarne Kvinge 254b122317 Fix compiler warning. 2015-06-22 16:01:31 +02:00
Sebastien Pouliot c9e4c13f14 Add native type support for comparison (not just equality) 2014-11-18 10:04:09 -05:00
Sebastien Pouliot 0a7ab05f5c Fix AreEqual for native types 2014-11-17 22:20:44 -05:00
Sebastien Pouliot 574e6373ba Add a slight extension for unified data types: nint, nuint, nfloat 2014-11-17 20:58:48 -05:00
Sebastien Pouliot 9f29e48549 Revert "mcs (mono 3.2.3) can't compile this"
This reverts commit 079bd2d351.
2013-11-28 10:52:01 -05:00