Skip to content

Commit

Permalink
Merge pull request #3239 from nunit/release-311
Browse files Browse the repository at this point in the history
Release 3.12
  • Loading branch information
rprouse committed May 14, 2019
2 parents 6588dbf + 735ecc5 commit c933a88
Show file tree
Hide file tree
Showing 300 changed files with 6,346 additions and 2,489 deletions.
56 changes: 43 additions & 13 deletions .editorconfig
Expand Up @@ -2,21 +2,18 @@
# maintain consistent coding styles between
# different editors and IDEs

# http://EditorConfig.org
# https://editorconfig.org

# top-most EditorConfig file
root = true

[*]
indent_style = space
indent_size = 4
insert_final_newline = true
charset = utf-8

[*.{proj,csproj,vcxproj,xproj,json,config,nuspec,xml,xsd}]
indent_size = 2


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

[*]
# https://github.com/nunit/docs/wiki/Coding-Standards#namespace-class-structure-interface-enumeration-and-method-definitions
Expand Down Expand Up @@ -59,21 +56,54 @@ dotnet_style_predefined_type_for_member_access = true:suggestion

dotnet_naming_style.pascal_case.capitalization = pascal_case

# Required
dotnet_naming_symbols.namespaces_types_and_non_field_members.applicable_kinds = namespace, class, struct, enum, interface, delegate, type_parameter, method, property, event
dotnet_naming_rule.namespaces_types_and_non_field_members.severity = suggestion
dotnet_naming_rule.namespaces_types_and_non_field_members.severity = error
dotnet_naming_rule.namespaces_types_and_non_field_members.symbols = namespaces_types_and_non_field_members
dotnet_naming_rule.namespaces_types_and_non_field_members.style = pascal_case

dotnet_naming_symbols.public_fields.applicable_kinds = field
dotnet_naming_symbols.public_fields.applicable_accessibilities = public
dotnet_naming_rule.public_fields.severity = suggestion
dotnet_naming_rule.public_fields.symbols = public_fields
dotnet_naming_rule.public_fields.style = pascal_case
# Required
dotnet_naming_symbols.visible_fields.applicable_kinds = field
dotnet_naming_symbols.visible_fields.applicable_accessibilities = public, protected, protected_internal
dotnet_naming_rule.visible_fields.severity = error
dotnet_naming_rule.visible_fields.symbols = visible_fields
dotnet_naming_rule.visible_fields.style = pascal_case

# Defaults without diagnostics
dotnet_naming_symbols.internal_fields.applicable_kinds = field
dotnet_naming_symbols.internal_fields.applicable_accessibilities = internal
dotnet_naming_rule.internal_fields.severity = none
dotnet_naming_rule.internal_fields.symbols = internal_fields
dotnet_naming_rule.internal_fields.style = pascal_case

# Defaults without diagnostics
dotnet_naming_symbols.static_readonly_fields.applicable_kinds = field
dotnet_naming_symbols.static_readonly_fields.required_modifiers = static, readonly
dotnet_naming_rule.static_readonly_fields.severity = none
dotnet_naming_rule.static_readonly_fields.symbols = static_readonly_fields
dotnet_naming_rule.static_readonly_fields.style = pascal_case

# Defaults without diagnostics
dotnet_naming_symbols.constant_fields.applicable_kinds = field
dotnet_naming_symbols.constant_fields.required_modifiers = const
dotnet_naming_rule.constant_fields.severity = none
dotnet_naming_rule.constant_fields.symbols = constant_fields
dotnet_naming_rule.constant_fields.style = pascal_case

dotnet_naming_style.underscore_camel_case.capitalization = camel_case
dotnet_naming_style.underscore_camel_case.required_prefix = _

# Required for newly added fields
dotnet_naming_symbols.remaining_fields.applicable_kinds = field
dotnet_naming_rule.remaining_fields.severity = suggestion
dotnet_naming_rule.remaining_fields.symbols = remaining_fields
dotnet_naming_rule.remaining_fields.style = underscore_camel_case

dotnet_naming_style.camel_case.capitalization = camel_case

# Required
dotnet_naming_symbols.parameters_and_locals.applicable_kinds = parameter, local
dotnet_naming_rule.parameters_and_locals.severity = suggestion
dotnet_naming_rule.parameters_and_locals.severity = error
dotnet_naming_rule.parameters_and_locals.symbols = parameters_and_locals
dotnet_naming_rule.parameters_and_locals.style = camel_case

Expand Down
5 changes: 4 additions & 1 deletion .gitignore
@@ -1,4 +1,4 @@
## Ignore Visual Studio temporary files, build results, and
## Ignore Visual Studio and Rider temporary files, build results, and
## files generated by popular Visual Studio add-ons.

# User-specific files
Expand Down Expand Up @@ -109,6 +109,9 @@ csx
# Windows Store app package directory
AppPackages/

# Rider specific folder
\.idea/

# Others
sql/
*.Cache
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -7,7 +7,7 @@ mono: 5.10.0 # Need 5.2+ for the included MSBuild.

matrix:
include:
- os: linux
- dist: xenial
install:
- sudo apt-get install dotnet-sharedframework-microsoft.netcore.app-1.1.6

Expand Down
14 changes: 8 additions & 6 deletions BUILDING.md
@@ -1,14 +1,14 @@
# Building NUnit 3

NUnit 3 consists of three separate layers: the Framework, the Engine and the Console Runner. The source code is kept in two GitHub repositories at http://github.com/nunit/nunit and http://github.com/nunit/nunit-console.
NUnit 3 consists of three separate layers: the Framework, the Engine and the Console Runner. The source code is kept in two GitHub repositories at https://github.com/nunit/nunit and https://github.com/nunit/nunit-console.

There are two ways to build NUnit: using the solution file in an IDE or through the build script. See also [Building and testing for Linux on a Windows machine](#building-and-testing-for-linux-on-a-windows-machine).

## 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.

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](http://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 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.

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

Expand All @@ -23,7 +23,7 @@ Other test projects contain tests designed to fail purposely for integration tes

## Build Script

We use [Cake](http://cakebuild.net) to build NUnit for distribution. The primary script that controls building, running tests and packaging is build.cake. We modify build.cake when we need to add new targets or change the way the build is done. Normally build.cake is not invoked directly but through build.ps1 (on Windows) or build.sh (on Linux). These two scripts are provided by the Cake project and ensure that Cake is properly installed before trying to run the cake script. This helps the build to work on CI servers using newly created agents to run the build and we generally run it the same way on our own machines.
We use [Cake](https://cakebuild.net) to build NUnit for distribution. The primary script that controls building, running tests and packaging is build.cake. We modify build.cake when we need to add new targets or change the way the build is done. Normally build.cake is not invoked directly but through build.ps1 (on Windows) or build.sh (on Linux). These two scripts are provided by the Cake project and ensure that Cake is properly installed before trying to run the cake script. This helps the build to work on CI servers using newly created agents to run the build and we generally run it the same way on our own machines.

The build shell script and build.cmd script are provided as an easy way to run the above commands. In addition to passing their arguments through to build.cake, they can supply added arguments through the CAKE_ARGS environment variable. The rest of this document will assume use of these commands.

Expand All @@ -35,6 +35,8 @@ Key arguments to build.cmd / build:
* -ShowDescription Shows all of the build tasks and their descriptions
* -Experimental, -e Use the experimental build of Roslyn

Note that the above format for supplying arguments only work on Windows. On Linux one has to use double dashes to specify the argument, like `./build.sh --target=Test` or `./build.sh --target Test` to run the `Test` task.

The build.cake script contains a large number of interdependent tasks. The most important top-level tasks to use are listed here:

```
Expand Down Expand Up @@ -70,14 +72,14 @@ 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):

- `ASYNC` enables asynchrony
- `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, `NET20` or `NET45`, `NETSTANDARD1_6`, `NETCOREAPP2_0`, and so on.
For example, `NET45`, `NETSTANDARD1_6`, `NETCOREAPP2_0`, 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.

Expand All @@ -92,7 +94,7 @@ For example, rather than this code:
Consider this:

```cs
#if !(NET20 || NET35 || NET40)
#if !(NET35 || NET40)
// Something that .NET Framework 4.0 can't do
#endif
```
78 changes: 76 additions & 2 deletions CHANGES.md
@@ -1,7 +1,81 @@
### NUnit 3.11 - October 11, 2018
### NUnit 3.12 - May 14, 2019

This release of NUnit finally drops support for .NET 2.0. If your application still
targets .NET 2.0, your tests will need to target at least .NET 3.5. Microsoft ended
support for .NET 2.0 on July 12, 2011. Microsoft recommends that everyone migrate
to at least .NET Framework 3.5 SP1 for security and performance fixes.

This release dramatically improves NUnit support for async tests including returning
ValueTask and custom tasks from tests, improved handling of SynchronizationContexts
and better exception handling.

The .NET Standard 2.0 version of NUnit continues to gain more functionality that
is found in the .NET 4.5 version of the framework like setting the ApartmentState
and enabling Timeout on tests.

#### Issues Resolved

* 474 TypeHelperTests.cs is orphaned
* 999 Support multiple TestOf attributes per test
* 1638 TimeoutAttribute not available when targeting netcoreapp framework
* 2168 ThrowsAsync reports OperationCanceledException as TaskCanceledException
* 2194 How to use `Contains.Substring` with `And`
* 2286 Add support for custom Task (i.e. ValueTask)
* 2579 AppVeyor Test Failures under .NET 3.5
* 2614 TestExecutionContext.CurrentContext is saved in Remoting CallContext between test runs
* 2696 Getting WorkerId fails in debug
* 2772 Random failing of parallel test run: Unhandled Exception: System.InvalidOperationException: Stack empty.
* 2975 ComparisonConstraints are allocating string on construction
* 3014 Timeout failures on MacOS
* 3023 NUnit runner fails when test method returns ValueTask<>
* 3035 Apartment state can't be used for .NET Standard 2.0 tests
* 3036 Apartment state can't be used for .NET Standard 2.0 tests
* 3038 TestName in TestCase attribute not validated to be not empty
* 3042 RequiresThreadAttribute allows ApartmentState.Unknown, unlike ApartmentAttribute
* 3048 Add .idea folder to .gitignore
* 3053 Conversion from TestCase string parameter to DateTimeOffset
* 3059 Constraint Throws.Exception does not work with async return value
* 3068 First Chance Exception in RuntimeFramework
* 3070 End support for .NET Framework 2.0 (released in 2005)
* 3073 CollectionAssert.AreEquivalent fails for ValueTuple Wrapped Dictionary
* 3079 Regression from 3.10 to 3.11: Range in bytes
* 3082 Is.Ordered.By
* 3085 XML Test-Suite Assembly does not contain DLL path anymore
* 3089 Remove outdated comment
* 3093 Tests having TaskLike objects as their return type throws Exception
* 3094 Bad error message if collections have different types
* 3104 Removed NET20 compile output
* 3105 Add tests for use of ApartmentState.Unknown in RequiresThreadAttribute
* 3107 Declare class in Program.cs provided with NUnitLite Nuget package static
* 3109 Azure DevOps build fails in Save package artifacts
* 3124 Switch copyright notice
* 3128 Correct documentation on ParallelScope
* 3137 Fix doc-comments in NUnitTestAssemblyRunner
* 3138 Assert.Ignore breaks when a Task is returned w/o using async/await
* 3139 Add Azure pipelines badge to frontpage
* 3144 Retry attribute should not derive from PropertyAttribute
* 3145 Capture additional exception details in the test output
* 3156 UnexpectedExceptionTests should tolerate Mono on Azure DevOps Ubuntu
* 3159 Make tests more tolerant
* 3161 https url repo
* 3166 Allow static SetUpFixture classes
* 3171 Incorrect type for Test Fixtures when using running explore with a filter
* 3175 Improve user-facing messages
* 3181 Template Based Test Naming - Incorrect truncation for individual arguments
* 3186 Fix licenseUrl element in nuspec, will be deprecated
* 3193 Cake Build Fails with Visual Studio 2019
* 3195 Drop or at least make Travis not required?
* 3231 Breaking change in filter functionality between framework 2.7 and 3.11
* 3209 Test fail when posting to SynchronizationContext.Current
* 3211 Fix logging
* 3218 Remove todos from the code base
* 3222 Our build script tests hang when run with Mono on Windows
* 3233 AndConstraint should write additional information from failed constraint

### NUnit 3.11 - October 6, 2018

* More informative assertion messages
* PlatformAttribute is available on and now detects .NET Core
* PlatformAttribute is available on .NET Standard and now detects .NET Core
* ValuesAttribute now works with nullable types
* Async tests detecting and running Windows Forms or WPF message pumps rather than deadlocking
* Support for UWP 10.0 is back via .NET Standard 1.4
Expand Down
6 changes: 3 additions & 3 deletions CODE_OF_CONDUCT.md
Expand Up @@ -40,7 +40,7 @@ Project maintainers who do not follow or enforce the Code of Conduct in good fai

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [https://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
[homepage]: https://contributor-covenant.org
[version]: https://contributor-covenant.org/version/1/4/
2 changes: 1 addition & 1 deletion LICENSE.txt
@@ -1,4 +1,4 @@
Copyright (c) 2018 Charlie Poole, Rob Prouse
Copyright (c) 2019 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 c933a88

Please sign in to comment.