Skip to content

Commit

Permalink
Merge pull request #3703 from nunit/release313
Browse files Browse the repository at this point in the history
Release 3.13
  • Loading branch information
rprouse committed Jan 7, 2021
2 parents 2580c30 + 2ae411f commit 2e2cb92
Show file tree
Hide file tree
Showing 472 changed files with 10,691 additions and 4,358 deletions.
6 changes: 6 additions & 0 deletions .editorconfig
Expand Up @@ -12,6 +12,9 @@ indent_style = space
insert_final_newline = true
charset = utf-8

[*.{sln,*proj}]
charset = utf-8-bom

[*.{cs,cake}]
indent_size = 4

Expand Down Expand Up @@ -113,3 +116,6 @@ dotnet_sort_system_directives_first = true
# https://github.com/nunit/docs/wiki/Coding-Standards#use-of-the-var-keyword
# Would be true:warning, except that that so much existing code is not consistent with the coding standard.
csharp_style_var_when_type_is_apparent = true:suggestion

# DOC100: Place text in paragraphs
dotnet_diagnostic.DOC100.severity = silent
5 changes: 4 additions & 1 deletion .gitignore
Expand Up @@ -184,4 +184,7 @@ MockAssemblyResult.xml
PortabilityAnalysis*.html
project.lock.json
*.project.lock.json
.dotnet
.dotnet
.config/dotnet-tools.json
*.err
*.out
25 changes: 0 additions & 25 deletions .travis.yml

This file was deleted.

21 changes: 4 additions & 17 deletions BUILDING.md
Expand Up @@ -6,9 +6,9 @@ There are two ways to build NUnit: using the solution file in an IDE or through

## Solution Build

The framework is built using a single Visual Studio solution, `nunit.sln`, which may be built with [Visual Studio 2017](https://www.visualstudio.com/vs/) on Windows and [Visual Studio for Mac](https://www.visualstudio.com/vs/) on macOS. Currently, MonoDevelop does not support the new multi-targeted `csproj` project format. Once MonoDevelop is updated, it should start working again. Until then, we recommend [Visual Studio Code](https://code.visualstudio.com/) and compiling using the build scripts on non-Windows platforms.
The framework is built using a single Visual Studio solution, `nunit.sln`, which may be built with [Visual Studio 2019 16.8](https://www.visualstudio.com/vs/) or newer on Windows and [Visual Studio for Mac](https://www.visualstudio.com/vs/) on macOS. Currently, MonoDevelop does not support the new multi-targeted `csproj` project format. Once MonoDevelop is updated, it should start working again. Until then, we recommend [Visual Studio Code](https://code.visualstudio.com/) and compiling using the build scripts on non-Windows platforms.

On all platforms, you will need to install [.NET Core 2.0.3 SDK](https://www.microsoft.com/net/download/windows) or newer. On Mac or Linux, you will need to install [Mono 5.2.0](https://www.mono-project.com/download/). Currently (as of 5.4.1), newer versions of Mono are broken and crash during the compile.
On all platforms, you will need to install [.NET 5.0 SDK](https://www.microsoft.com/net/download/windows) or newer. On Mac or Linux, you will need to install [Mono 5.2.0](https://www.mono-project.com/download/). Currently (as of 5.4.1), newer versions of Mono are broken and crash during the compile.

The solutions all place their output in a common bin directory under the solution root.

Expand Down Expand Up @@ -53,16 +53,6 @@ For a full list of tasks, run `build.cmd -ShowDescription`.
1. By design, the Package target does not depend on Build. This is to allow re-packaging when necessary without changing the binaries themselves. Of course, this means that you have to be very careful that the build is up to date before packaging.
2. For additional targets, refer to the build.cake script itself.

### Building and testing for Linux on a Windows machine

Most of the time, it's not necessary to build or run tests on platforms other than your primary platform. The continuous integration which runs on every PR is enough to catch any problems.

Once in a while you may find it desirable to be primarily developing the repository on a Windows machine but to run Linux tests on the same set of files while you edit them in Windows. One convenient way to do this is to pass the same arguments to [build-mono-docker.ps1](.\build-mono-docker.ps1) that you would pass to build.ps1. It requires [Docker](https://docs.docker.com/docker-for-windows/install/) to be installed.

For example, to build and test everything: `.\build-mono-docker.ps1 -t test`

This will run a temporary container using the latest [Mono image](https://hub.docker.com/r/library/mono/), mounting the repo inside the container and executing the [build.sh](build.sh) Cake bootstrapper with the arguments you specify.

### Defined constants

NUnit often uses conditional preprocessor to light up APIs and behaviors per platform.
Expand All @@ -73,20 +63,17 @@ This brings clarity to the code and makes it easy to change the mapping between
Feature constants are defined in [Directory.Build.props](src/NUnitFramework/Directory.Build.props):

- `TASK_PARALLEL_LIBRARY_API` exposes NUnit APIs which depend on the TPL framework types
- `PARALLEL` enables running tests in parallel
- `PLATFORM_DETECTION` enables platform detection
- `THREAD_ABORT` enables timeouts and forcible cancellation
- `APARTMENT_STATE` enables control of the thread apartment state

Platform constants are defined by convention by the csproj SDK, one per target framework.
For example, `NET45`, `NETSTANDARD1_6`, `NETCOREAPP2_0`, and so on.
For example, `NET45`, `NETSTANDARD2_0`, `NETCOREAPP2_1`, and so on.
It is most helpful to call out which platforms are the exception in rather than the rule
in a given scenario. Keep in mind the effect the preprocessor would have on a newly added platform.

For example, rather than this code:

```cs
#if NET45 || NETSTANDARD1_6 || NETSTANDARD2_0
#if NET45 || NETSTANDARD2_0 || NETSTANDARD2_1
// Something that .NET Framework 4.0 can't do
#endif
```
Expand Down
134 changes: 124 additions & 10 deletions CHANGES.md
@@ -1,3 +1,118 @@
## NUnit 3.13 - January 7, 2021

The [`FixtureLifeCycle`](https://docs.nunit.org/articles/nunit/writing-tests/attributes/fixturelifecycle.html) attribute has been added to indicate that an instance for a test fixture or all test fixtures in an assembly should be constructed for each test within the fixture or assembly.

This attribute may be applied to a test fixture (class) or to a test assembly. It is useful in combination with the [Parallelizable Attribute](https://docs.nunit.org/articles/nunit/writing-tests/attributes/parallelizable.html) so that a new instance of a test fixture is constructed for every test within the test fixture. This allows tests to run in isolation without sharing instance fields and properties during parallel test runs. This make running parallel tests easier because it is easier to make your tests thread safe.

This release also fixes several issues running tests in .NET 5.0. If your tests target .NET 5.0, we recommend updating to this release.

#### Issues Resolved

* 34 Async testing with F#
* 52 Self-contained item in array causes stack overflow
* 1394 Has.Property cannot see explicit interface implementation properties
* 1491 Add a CLA to the project
* 1546 NUnitEqualityComparer.GetEquatableGenericArguments should explicitly order arguments
* 1809 Assert.AreEqual fails for Complex on Linux
* 1897 EqualTo().Using() prevents caller from comparing strings to anything else
* 2211 Request: Add support of indexers to the PropertyConstraint
* 2477 Parameterized fixture with Explicit attribute can not be run when selected by name
* 2574 Instance-per-test-case feature
* 2680 Deprecate the DebugWriter class
* 3611 Properties are shown when --explore:nunit3 is run on entire project, but omitted when using the --where clause
* 3054 Don't enforce `[Timeout]` when debugger is attached
* 3075 Complete RunAsyncAction tests in FrameworkControllerTests
* 3228 Modulo bias is present in Randomizer.NextDecimal(decimal)
* 3240 Automate uploading of test results to Azure Pipelines
* 3243 Azure DevOps does not build release branch
* 3249 Pin GitLink version to speed up Cake script
* 3251 RawInt32() can't use Next since the maximum is always exclusive and it would never return int.MaxValue
* 3252 Timeout of 100 ms in TestTimeoutDoesNotStopCompletion occasionally fails the macOS build
* 3253 Chance of failure in random bias tests is not sufficiently low for CI
* 3256 Building under VS2019
* 3257 Running under mono
* 3259 The type of an Array isn't inferred from properly
* 3264 Test that IRepeatTest only gets attributes via the IMethodInfo interface
* 3275 Enable setting IgnoreUntilDate in TestCaseData.Ignore
* 3279 Improve failure message from UniqueItemsConstraint
* 3282 TimeoutAttribute makes all Assertions count as failure
* 3283 ExecutionContext is flowed between unrelated tests
* 3286 Testing for equality using a predicate throws exception for collections
* 3290 'Good first issue' or 'help wanted' issue count badge
* 3296 ExceptionHelper.GetExceptionMessage(Exception ex) should tolerate exceptions from exceptions
* 3302 Incorrect formatting of failure message if test fails with Assert.Multiple
* 3303 Check type of actual argument using consistent helper method
* 3304 CheckString should not be a generic method
* 3305 Remove unused methods
* 3307 Sporadic GetResultIsNotCalledUntilContinued failure
* 3308 Fix disposal in EnumerablesComparer
* 3309 Simplify code in EventListenerTextWriter
* 3311 Minimal unit of DateTime in the report when Test was started/ended
* 3312 Simplify ProviderCache and make it instantiable since it is intentionally not thread safe
* 3315 Assert.DoesNotThrow() stopped working as it was previously
* 3318 Fix AwaitAdapter terminology
* 3321 Keep dependencies up to date
* 3322 Speed up build script by removing unnecessary builds
* 3324 Broken link in CHANGES.md
* 3328 Problems when using a mixture of Not and Or filters in NUnit framework 3.12.0
* 3331 Contains.Key no longer working for IDictionary
* 3338 Azure Pipelines is failing on Linux for both netstandard 1.4 and 2.0
* 3356 SetUpFixture not run
* 3368 Tests with warnings are not added to console TestResult.xml's total count
* 3383 Drop netstandard1.4 and stop testing on end-of-life versions of .NET Core
* 3389 Show names of parameters
* 3390 SetUpFixture not being triggered when running tests using --testlist
* 3392 Use of Thread.CurrentPrincipal in Blazor/WASM
* 3393 Nuget Package Not Signed
* 3395 Randomizer.NextString() can probably be sped up
* 3408 Save test results as build artifacts
* 3411 Update nuspec file to mention support for NET Standard 2.0+
* 3414 Azure pipelines are failing on Linux
* 3415 Azure CI: Still publish test results on failure
* 3423 TestResult.cs casts ITestResult to TestResult
* 3447 Is.EqualTo(...).Using(StructuralComparisons.StructuralEqualityComparer or StructuralComparer) not working
* 3452 Assertions that use an existing Regex
* 3453 Visibility of SetUp/TearDown Methods
* 3454 Pre-Filtering in NUnitLite has problems
* 3464 Improve debugging experience
* 3470 Assertion for key-value-pair
* 3475 Our XML comments are using `<code>` (block element) instead of `<c>` (inline element)
* 3485 Should we make MultipleAssertException.TestResult maybe-null or obsolete two constructors?
* 3496 Adding data dictionary should not add a trailing newline
* 3497 Fix mixed line endings in Git
* 3503 Remove implicit cast from ITestResult to TestResult
* 3505 Better failure messages for Subset and Superset constraints
* 3506 ValueTuple tests now running if not targeting NET35
* 3536 Reduce newly added API surface
* 3542 Update NuGet Package Icons
* 3547 DelayedConstraint constrains does not preserve original result additional information
* 3551 Add PrivateAssets="all" to analyzer dependency
* 3552 MessagePumpStrategy does not work for WPF on netcoreapp3.0 and upwards
* 3559 Disables the DOC100 suggestion and reverts the added paragraph elements
* 3563 `[Suggestion]` Improve TextMessageWriter output for numeric values
* 3565 .NET 5 issue with PlatformAttribute
* 3583 Avoid using a culture-sensitive EndsWith in common code
* 3592 Add classname and methodname to the start-test event
* 3594 Reduce memory overhead of TestNameGenerator
* 3596 AreAlmostEqualUlps throws OverflowException for -0
* 3598 Fix typo
* 3608 `[Platform]` attribute fails with DllNotFoundException in WASM
* 3616 Extend Is.Empty to work for Guid.Empty
* 3618 NUnit has a P/Invoke whose native function doesn't exist on all platforms
* 3622 EmptyDirectoryConstraint doesn't need to enumerate entire directory contents
* 3632 Assert.Inconclusive() reports failed when timeout used
* 3636 NUnitLite filtering fails if space in test name before (
* 3641 Type implementing `IComparable<float>` (or any `IComparable`) fails comparison.
* 3647 Fix exception under blazor 5
* 3650 Build issue with the latest .NET SDK 5.0.100-rc.2
* 3657 Add Framework Version to the XML
* 3662 TestContext.CurrentContext.CurrentRepeatCount only contains retry count not the repeat count
* 3667 Create FrameworkPackageSetting to set CurrentCulture and CurrentUICulture
* 3676 Parallelizeable tests sometimes shares memory
* 3679 Issue 3390: Do not prefilter relevant SetUpFixtures
* 3694 Async tests causes double failure messages
* 3699 Compilation of netcoreapp3.1 targets fails on CI (both AppVeyor and Azure Pipelines)

### NUnit 3.12 - May 14, 2019

This release of NUnit finally drops support for .NET 2.0. If your application still
Expand Down Expand Up @@ -1071,7 +1186,7 @@ use the NUnit NuGet packages for the framework, but a ZIP file with the binaries

### NUnit 3.0.0 Beta 2 - May 12, 2015

####Framework
#### Framework

* The Compact Framework version of the framework is now packaged separately
and will be distributed as a ZIP file and as a NuGet package.
Expand All @@ -1089,8 +1204,7 @@ use the NUnit NuGet packages for the framework, but a ZIP file with the binaries

* Added a core engine which is a non-extensible, minimal engine for use by
devices and similar situations where reduced functionality is compensated
for by reduced size and simplicity of usage. See
https://github.com/nunit/dev/wiki/Core-Engine for more information.
for by reduced size and simplicity of usage.

#### Issues Resolved

Expand Down Expand Up @@ -1658,7 +1772,7 @@ NOTE: Bug Fixes below this point refer to the number of the bug in Launchpad.
* 561436 SetCulture broken with 2.5.4
* 563532 DatapointsAttribute should be allowed on properties and methods

###NUnit 2.9.3 - October 26, 2009
### NUnit 2.9.3 - October 26, 2009

#### Main Features

Expand All @@ -1672,29 +1786,29 @@ NOTE: Bug Fixes below this point refer to the number of the bug in Launchpad.
* 432805 Some Framework Tests don't run on Linux
* 440109 Full Framework does not support "Contains"

###NUnit 2.9.2 - September 19, 2009
### NUnit 2.9.2 - September 19, 2009

####Main Features
#### Main Features

* NUnitLite code is now merged with NUnit
* Added NUnitLite runner to the framework code
* Added Compact framework builds

####Bug Fixes
#### Bug Fixes

* 430100 `Assert.Catch<T>` should return T
* 432566 NUnitLite shows empty string as argument
* 432573 Mono test should be at runtime

###NUnit 2.9.1 - August 27, 2009
### NUnit 2.9.1 - August 27, 2009

####General
#### General

* Created a separate project for the framework and framework tests
* Changed license to MIT / X11
* Created Windows installer for the framework

####Bug Fixes
#### Bug Fixes

* 400502 NUnitEqualityComparer.StreamsE­qual fails for same stream
* 400508 TestCaseSource attirbute is not working when Type is given
Expand Down
4 changes: 1 addition & 3 deletions CONTRIBUTING.md
Expand Up @@ -34,9 +34,7 @@ Issues that need confirmation will have the **confirm** label or be unlabeled an
- Create unit tests to demonstrate the issue
- Test issues and provide feedback

As of version 3.10, the NUnit and NUnitLite NuGet packages support **debugger source-stepping** for each binary from the repository. Debuggers can step into the source code, set breakpoints, watch variables, etc. If you’re getting ready to report a bug in NUnit, figuring out how to create a minimal repro is much easier since you aren’t dealing with a black box!

To easily drop into NUnit code from your project any time, [follow these steps](https://github.com/nunit/docs/wiki/Debugger-Source-Stepping).
If you’re getting ready to report a bug in NUnit, figuring out how to create a minimal repro is easier if you temporarily disable the debugger’s [Just My Code](https://docs.microsoft.com/en-us/visualstudio/debugger/just-my-code) setting. This allows you to step into NUnit's source code, set breakpoints, watch variables, etc.

## Documentation

Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
@@ -1,4 +1,4 @@
Copyright (c) 2019 Charlie Poole, Rob Prouse
Copyright (c) 2021 Charlie Poole, Rob Prouse

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down

0 comments on commit 2e2cb92

Please sign in to comment.