Skip to content

Commit

Permalink
Update to VS2022. Added latest NUnit settings. Changed links to point…
Browse files Browse the repository at this point in the history
… to VS2022.
  • Loading branch information
OsirisTerje committed Mar 27, 2022
1 parent 976b14b commit a24f60b
Show file tree
Hide file tree
Showing 13 changed files with 122 additions and 100 deletions.
8 changes: 6 additions & 2 deletions AllTemplate/AllRunSettings.runsettings
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- File name extension must be .runsettings -->
<!-- For more information, see https://docs.microsoft.com/en-us/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file?view=vs-2019 -->
<!-- For more information, see https://docs.microsoft.com/en-us/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file?view=vs-2022 -->
<RunSettings>
<RunConfiguration>
<!-- See https://github.com/microsoft/vstest-docs/blob/master/docs/configure.md -->
Expand Down Expand Up @@ -167,7 +167,7 @@ Included items must then not match any entries in the exclude list to remain inc
</TestRunParameters>
-->

<!-- Section for loggers, see https://docs.microsoft.com/en-us/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file?view=vs-2019#loggerrunsettings-element
<!-- Section for loggers, see https://docs.microsoft.com/en-us/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file?view=vs-2022#loggerrunsettings-element
<LoggerRunSettings>
<Loggers>
<Logger friendlyName="console" enabled="True">
Expand Down Expand Up @@ -248,6 +248,10 @@ Included items must then not match any entries in the exclude list to remain inc
<DiscoveryMethod>Current</DiscoveryMethod>
<!--Legacy or Current-->
<AssemblySelectLimit>2000</AssemblySelectLimit>
<NewOutputXmlFileForEachRun>false</NewOutputXmlFileForEachRun>
<IncludeStackTraceForSuites>true</IncludeStackTraceForSuites>
<ExplicitMode>Strict</ExplicitMode>
<SkipExecutionWhenNoTests>false</SkipExecutionWhenNoTests>
</NUnit>

</RunSettings>
Binary file modified AllTemplate/AllRunSettings.zip
Binary file not shown.
8 changes: 6 additions & 2 deletions CoverageNoParallelTemplate/CoverageNoParallel.runsettings
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- File name extension must be .runsettings -->
<!-- For more information, see https://docs.microsoft.com/en-us/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file?view=vs-2019 -->
<!-- For more information, see https://docs.microsoft.com/en-us/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file?view=vs-2022 -->

<RunSettings>
<RunConfiguration>
Expand Down Expand Up @@ -168,7 +168,7 @@ Included items must then not match any entries in the exclude list to remain inc
</TestRunParameters>
-->

<!-- Section for loggers, see https://docs.microsoft.com/en-us/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file?view=vs-2019#loggerrunsettings-element
<!-- Section for loggers, see https://docs.microsoft.com/en-us/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file?view=vs-2022#loggerrunsettings-element
<LoggerRunSettings>
<Loggers>
<Logger friendlyName="console" enabled="True">
Expand Down Expand Up @@ -247,5 +247,9 @@ Included items must then not match any entries in the exclude list to remain inc
<DiscoveryMethod>Current</DiscoveryMethod>
<!--Legacy or Current-->
<AssemblySelectLimit>2000</AssemblySelectLimit>
<NewOutputXmlFileForEachRun>false</NewOutputXmlFileForEachRun>
<IncludeStackTraceForSuites>true</IncludeStackTraceForSuites>
<ExplicitMode>Strict</ExplicitMode>
<SkipExecutionWhenNoTests>false</SkipExecutionWhenNoTests>
</NUnit>
</RunSettings>
Binary file modified CoverageNoParallelTemplate/coveragenoparallel.zip
Binary file not shown.
Binary file modified ItemTemplates/AllRunSettings.zip
Binary file not shown.
Binary file modified ItemTemplates/coveragenoparallel.zip
Binary file not shown.
Binary file modified ItemTemplates/parallel.zip
Binary file not shown.
178 changes: 92 additions & 86 deletions ParallelTemplate/parallel.runsettings
Original file line number Diff line number Diff line change
@@ -1,60 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- For more information, see https://docs.microsoft.com/en-us/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file?view=vs-2019 -->
<!-- For more information, see https://docs.microsoft.com/en-us/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file?view=vs-2022 -->

<RunSettings>
<RunConfiguration>
<!-- See https://github.com/microsoft/vstest-docs/blob/master/docs/configure.md -->
<!-- 1. Test related settings -->
<!-- [x86] | x64: architecture of test host -->
<!--<TargetPlatform>x86</TargetPlatform>-->
<RunConfiguration>
<!-- See https://github.com/microsoft/vstest-docs/blob/master/docs/configure.md -->
<!-- 1. Test related settings -->
<!-- [x86] | x64: architecture of test host -->
<!--<TargetPlatform>x86</TargetPlatform>-->

<!-- Framework35 | [Framework40] | Framework45 -->
<!--<TargetFrameworkVersion>Framework40</TargetFrameworkVersion>-->
<!-- Framework35 | [Framework40] | Framework45 -->
<!--<TargetFrameworkVersion>Framework40</TargetFrameworkVersion>-->

<!-- Path to Test Adapters -->
<!--<TestAdaptersPaths>%SystemDrive%\Temp\foo;%SystemDrive%\Temp\bar</TestAdaptersPaths>-->
<TreatTestAdapterErrorsAsWarnings>false</TreatTestAdapterErrorsAsWarnings>
<!-- Path to Test Adapters -->
<!--<TestAdaptersPaths>%SystemDrive%\Temp\foo;%SystemDrive%\Temp\bar</TestAdaptersPaths>-->
<TreatTestAdapterErrorsAsWarnings>false</TreatTestAdapterErrorsAsWarnings>

<!-- Path relative to solution directory -->
<ResultsDirectory>.\TestResults</ResultsDirectory>
<!-- Path relative to solution directory -->
<ResultsDirectory>.\TestResults</ResultsDirectory>

<!-- 0 = As many processes as possible, limited by number of cores on machine, 1 = Sequential (1 process), 2-> Given number of processes up to limit by number of cores on machine-->
<MaxCpuCount>0</MaxCpuCount>
<!-- 0 = As many processes as possible, limited by number of cores on machine, 1 = Sequential (1 process), 2-> Given number of processes up to limit by number of cores on machine-->
<MaxCpuCount>0</MaxCpuCount>

<!-- TestSessionTimeout was introduced in Visual Studio 2017 version 15.5 -->
<!-- Specify timeout in milliseconds. A valid value should be >= 0. If 0, timeout will be infinity-->
<TestSessionTimeout>10000</TestSessionTimeout>
<!-- TestSessionTimeout was introduced in Visual Studio 2017 version 15.5 -->
<!-- Specify timeout in milliseconds. A valid value should be >= 0. If 0, timeout will be infinity-->
<TestSessionTimeout>10000</TestSessionTimeout>

<!-- Specify a Boolean value, which defines the exit code when no tests are discovered.-->
<TreatNoTestsAsError>false</TreatNoTestsAsError>
<!-- Specify a Boolean value, which defines the exit code when no tests are discovered.-->
<TreatNoTestsAsError>false</TreatNoTestsAsError>

<!-- STA | MTA default is STA for .NET Full and MTA for .NET Core-->
<!--<ExecutionThreadApartmentState>STA</ExecutionThreadApartmentState>-->
<!-- STA | MTA default is STA for .NET Full and MTA for .NET Core-->
<!--<ExecutionThreadApartmentState>STA</ExecutionThreadApartmentState>-->

<!-- Disables in-assembly parallel execution, applies to both MSTest and NUnit -->
<DisableParallelization>false</DisableParallelization>
<DisableAppDomain>false</DisableAppDomain>
<CollectSourceInformation>true</CollectSourceInformation>
<!-- Disables in-assembly parallel execution, applies to both MSTest and NUnit -->
<DisableParallelization>false</DisableParallelization>
<DisableAppDomain>false</DisableAppDomain>
<CollectSourceInformation>true</CollectSourceInformation>

<!-- Runner related configuration -->
<BatchSize>10</BatchSize>
<!-- Runner related configuration -->
<BatchSize>10</BatchSize>

</RunConfiguration>
</RunConfiguration>

<!-- <DataCollectionRunSettings>
<!-- <DataCollectionRunSettings>
<DataCollectors> -->
<!-- This option can help you isolate a problematic test that causes a test host crash. Running the collector creates an output file (Sequence.xml) in TestResults, which captures the order of execution of the test before the crash. -->
<!-- <DataCollector friendlyName="blame" enabled="True">
<!-- This option can help you isolate a problematic test that causes a test host crash. Running the collector creates an output file (Sequence.xml) in TestResults, which captures the order of execution of the test before the crash. -->
<!-- See https://docs.microsoft.com/en-us/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file?view=vs-2022#blame-data-collector-->
<!-- <DataCollector friendlyName="blame" enabled="True">
</DataCollectors> -->
<!-- </DataCollectionRunSettings> -->
<!-- </DataCollectionRunSettings> -->

<!--
<!--
<TestRunParameters>
<Parameter name="webAppUrl" value="http://localhost" />
<Parameter name="webAppUserName" value="Admin" />
</TestRunParameters> -->

<!-- Section for loggers, see https://docs.microsoft.com/en-us/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file?view=vs-2019#loggerrunsettings-element
<!-- Section for loggers, see https://docs.microsoft.com/en-us/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file?view=vs-2022#loggerrunsettings-element
<LoggerRunSettings>
<Loggers>
<Logger friendlyName="console" enabled="True">
Expand All @@ -77,62 +78,67 @@
-->


<!-- Adapter Specific sections -->
<!-- Adapter Specific sections -->

<!-- MSTest adapter -->
<MSTest>
<MapInconclusiveToFailed>false</MapInconclusiveToFailed>
<CaptureTraceOutput>true</CaptureTraceOutput>
<DeleteDeploymentDirectoryAfterTestRunIsComplete>true</DeleteDeploymentDirectoryAfterTestRunIsComplete>
<DeploymentEnabled>true</DeploymentEnabled>
<DeployTestSourceDependencies>true</DeployTestSourceDependencies>
<MapNotRunnableToFailed>false</MapNotRunnableToFailed>
<EnableBaseClassTestMethodsFromOtherAssemblies>false</EnableBaseClassTestMethodsFromOtherAssemblies>
<!-- <TestTimeout>5000</TestTimeout> -->
<!-- MSTest adapter -->
<MSTest>
<MapInconclusiveToFailed>false</MapInconclusiveToFailed>
<CaptureTraceOutput>true</CaptureTraceOutput>
<DeleteDeploymentDirectoryAfterTestRunIsComplete>true</DeleteDeploymentDirectoryAfterTestRunIsComplete>
<DeploymentEnabled>true</DeploymentEnabled>
<DeployTestSourceDependencies>true</DeployTestSourceDependencies>
<MapNotRunnableToFailed>false</MapNotRunnableToFailed>
<EnableBaseClassTestMethodsFromOtherAssemblies>false</EnableBaseClassTestMethodsFromOtherAssemblies>
<!-- <TestTimeout>5000</TestTimeout> -->

<!-- Uncomment and update path for assembly resolution -->
<!-- <AssemblyResolution>
<!-- Uncomment and update path for assembly resolution -->
<!-- <AssemblyResolution>
<Directory path="D:\myfolder\bin\" includeSubDirectories="false"/>
</AssemblyResolution> -->
<ForcedLegacyMode>false</ForcedLegacyMode>
<!--
<ForcedLegacyMode>false</ForcedLegacyMode>
<!--
<SettingsFile>a .testsettings file (require ForcedLegacyMode true) </SettingsFile>
-->
</MSTest>

<!-- NUnit3 adapter, uncomment sections to set as appropriate, numeric, booleans, enums have their default values below, except RandomSeed -->
<!-- For documentation, see https://docs.nunit.org/articles/vs-test-adapter/Tips-And-Tricks.html -->
<NUnit>
<!--<BasePath>D:\Dev\NUnit\nunit3-vs-adapter\demo\NUnitTestDemo\bin\Release</BasePath>-->
<!--<PrivateBinPath>extras;more.extras</PrivateBinPath>-->
<DefaultTimeout>0</DefaultTimeout>
<!--<WorkDirectory>work</WorkDirectory>-->
<InternalTraceLevel>Off</InternalTraceLevel>
<!--<RandomSeed>1234567</RandomSeed>-->
<NumberOfTestWorkers>-1</NumberOfTestWorkers>
<Verbosity>0</Verbosity>
<!--<UseVsKeepEngineRunning>false</UseVsKeepEngineRunning>-->
<!--<ShadowCopyFiles>false</ShadowCopyFiles>-->
<!--<DefaultTestNamePattern>{m}{a}</DefaultTestNamePattern>-->
<!--<DomainUsage>Single</DomainUsage>-->
<DumpXmlTestDiscovery>false</DumpXmlTestDiscovery>
<DumpXmlTestResults>false</DumpXmlTestResults>
<ShowInternalProperties>false</ShowInternalProperties>
<!--<TestOutputXml>TestOutputXml</TestOutputXml>-->
<!--<Where></Where>-->
<!-- NUnit filter expression, see https://docs.nunit.org/articles/nunit/running-tests/Test-Selection-Language.html -->
<ConsoleOut>1</ConsoleOut>
<UseTestNameInConsoleOutput>true</UseTestNameInConsoleOutput>
<StopOnError>false</StopOnError>
<SkipNonTestAssemblies>false</SkipNonTestAssemblies>
<MapWarningTo>Skipped</MapWarningTo>
<!--Passed, Failed or Skipped-->
<DisplayName>Name</DisplayName>
<!--Name, FullName or FullNameSep-->
<FullnameSeparator>:</FullnameSeparator>
<DiscoveryMethod>Current</DiscoveryMethod>
<!--Legacy or Current-->
<AssemblySelectLimit>2000</AssemblySelectLimit>
</NUnit>
</MSTest>

<!-- NUnit3 adapter, uncomment sections to set as appropriate, numeric, booleans, enums have their default values below, except RandomSeed -->
<!-- For documentation, see https://docs.nunit.org/articles/vs-test-adapter/Tips-And-Tricks.html -->
<NUnit>
<!--<BasePath>D:\Dev\NUnit\nunit3-vs-adapter\demo\NUnitTestDemo\bin\Release</BasePath>-->
<!--<PrivateBinPath>extras;more.extras</PrivateBinPath>-->
<DefaultTimeout>0</DefaultTimeout>
<!--<WorkDirectory>work</WorkDirectory>-->
<InternalTraceLevel>Off</InternalTraceLevel>
<!--<RandomSeed>1234567</RandomSeed>-->
<NumberOfTestWorkers>-1</NumberOfTestWorkers>
<Verbosity>0</Verbosity>
<!--<UseVsKeepEngineRunning>false</UseVsKeepEngineRunning>-->
<!--<ShadowCopyFiles>false</ShadowCopyFiles>-->
<!--<DefaultTestNamePattern>{m}{a}</DefaultTestNamePattern>-->
<!--<DomainUsage>Single</DomainUsage>-->
<DumpXmlTestDiscovery>false</DumpXmlTestDiscovery>
<DumpXmlTestResults>false</DumpXmlTestResults>
<ShowInternalProperties>false</ShowInternalProperties>
<!--<TestOutputXml>TestOutputXml</TestOutputXml>-->
<!--<Where></Where>-->
<!-- NUnit filter expression, see https://docs.nunit.org/articles/nunit/running-tests/Test-Selection-Language.html -->
<ConsoleOut>1</ConsoleOut>
<UseTestNameInConsoleOutput>true</UseTestNameInConsoleOutput>
<StopOnError>false</StopOnError>
<SkipNonTestAssemblies>false</SkipNonTestAssemblies>
<MapWarningTo>Skipped</MapWarningTo>
<!--Passed, Failed or Skipped-->
<DisplayName>Name</DisplayName>
<!--Name, FullName or FullNameSep-->
<FullnameSeparator>:</FullnameSeparator>
<DiscoveryMethod>Current</DiscoveryMethod>
<!--Legacy or Current-->
<AssemblySelectLimit>2000</AssemblySelectLimit>
<NewOutputXmlFileForEachRun>false</NewOutputXmlFileForEachRun>
<IncludeStackTraceForSuites>true</IncludeStackTraceForSuites>
<ExplicitMode>Strict</ExplicitMode>
<SkipExecutionWhenNoTests>false</SkipExecutionWhenNoTests>

</NUnit>
</RunSettings>

Binary file modified ParallelTemplate/parallel.zip
Binary file not shown.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
### RunSettings for "real" developers who write unit tests
A set of runsettings item templates for Visual Studio 2019 and 2017. [For earlier versions see the links below]
A set of runsettings item templates for Visual Studio 2022, 2019 and 2017. [For earlier versions see the links below]

The runsettings file is used by all developers who love unit tests.

This template automates the creation of the default runsettings under solution items.
Never do this manually again!

The runsettings contains separate sections for the adapters. The settings for the [NUnit Adapter is described here](https://github.com/nunit/docs/wiki/Tips-And-Tricks) and [MSTest adapter is described here](https://docs.microsoft.com/en-us/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file?view=vs-2019#mstest-run-settings).
The runsettings contains separate sections for the adapters. The settings for the [NUnit Adapter is described here](https://github.com/nunit/docs/wiki/Tips-And-Tricks) and [MSTest adapter is described here](https://docs.microsoft.com/en-us/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file?view=vs-2022#mstest-run-settings).

### How to use
Right click the solution. Choose Add | New Item and choose one of the Runsettings under General. Observe that the runsettings file was added as a Solution Item.
Expand All @@ -21,8 +21,8 @@ This template automates the creation of the default runsettings under solution i
Also used to change the code coverage analysis settings for a test run. Set which files should be included and excluded from analysis, and also set symbol search paths.  Also set Runconfigurations and testrunparameters, and specific settings for NUnit and MSTest. 

Learn how to configure and customize runsettings:
- https://docs.microsoft.com/en-us/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file?view=vs-2019
- https://docs.microsoft.com/en-us/visualstudio/test/customizing-code-coverage-analysis?view=vs-2019
- https://docs.microsoft.com/en-us/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file?view=vs-2022
- https://docs.microsoft.com/en-us/visualstudio/test/customizing-code-coverage-analysis?view=vs-2022

Enjoy!

Expand All @@ -34,6 +34,8 @@ More information on [NUnit parallel execution](https://github.com/nunit/docs/wik
### Templates
There are 3 templates included, one complete which includes code coverage and parallel run, one with only code coverage, and one with only parallel run. The latter can also be used as the most simple runsettings template.

To enable automatic running of the runsettings file, rename the one you choose to **.runsettings**.

For more information see this blog post: [How to exclude code from code coverage in Visual Studio](http://hermit.no/how-to-exclude-code-from-code-coverage-in-visual-studio-unit-testing-using-runsettings/) 

### Why are there no settings for XUnit included
Expand Down
5 changes: 3 additions & 2 deletions ReleaseNotes.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Note: VS2012, VS2013, VS2015 and VS2017/19 have separate downloads, see links on each one.

Note: VS2012, VS2013, VS2015 and VS2017/19/22 have separate downloads, see links on each one.

6.0.0
Support for VS 2022

5.9.1
Hotfix removing the DesignMode. It is an automatically set property from the IDE, and should not be manually edited.
Expand Down
2 changes: 1 addition & 1 deletion build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var configuration = Argument("configuration", "Release");
// SET PACKAGE VERSION
//////////////////////////////////////////////////////////////////////

var version = "5.9.1";
var version = "6.0.0";
var modifier = "";

var dbgSuffix = configuration == "Debug" ? "-dbg" : "";
Expand Down
Loading

0 comments on commit a24f60b

Please sign in to comment.