Skip to content

Commit a24f60b

Browse files
committed
Update to VS2022. Added latest NUnit settings. Changed links to point to VS2022.
1 parent 976b14b commit a24f60b

File tree

13 files changed

+122
-100
lines changed

13 files changed

+122
-100
lines changed

AllTemplate/AllRunSettings.runsettings

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- File name extension must be .runsettings -->
3-
<!-- For more information, see https://docs.microsoft.com/en-us/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file?view=vs-2019 -->
3+
<!-- For more information, see https://docs.microsoft.com/en-us/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file?view=vs-2022 -->
44
<RunSettings>
55
<RunConfiguration>
66
<!-- See https://github.com/microsoft/vstest-docs/blob/master/docs/configure.md -->
@@ -167,7 +167,7 @@ Included items must then not match any entries in the exclude list to remain inc
167167
</TestRunParameters>
168168
-->
169169

170-
<!-- 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
170+
<!-- 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
171171
<LoggerRunSettings>
172172
<Loggers>
173173
<Logger friendlyName="console" enabled="True">
@@ -248,6 +248,10 @@ Included items must then not match any entries in the exclude list to remain inc
248248
<DiscoveryMethod>Current</DiscoveryMethod>
249249
<!--Legacy or Current-->
250250
<AssemblySelectLimit>2000</AssemblySelectLimit>
251+
<NewOutputXmlFileForEachRun>false</NewOutputXmlFileForEachRun>
252+
<IncludeStackTraceForSuites>true</IncludeStackTraceForSuites>
253+
<ExplicitMode>Strict</ExplicitMode>
254+
<SkipExecutionWhenNoTests>false</SkipExecutionWhenNoTests>
251255
</NUnit>
252256

253257
</RunSettings>

AllTemplate/AllRunSettings.zip

77 Bytes
Binary file not shown.

CoverageNoParallelTemplate/CoverageNoParallel.runsettings

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- File name extension must be .runsettings -->
3-
<!-- For more information, see https://docs.microsoft.com/en-us/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file?view=vs-2019 -->
3+
<!-- For more information, see https://docs.microsoft.com/en-us/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file?view=vs-2022 -->
44

55
<RunSettings>
66
<RunConfiguration>
@@ -168,7 +168,7 @@ Included items must then not match any entries in the exclude list to remain inc
168168
</TestRunParameters>
169169
-->
170170

171-
<!-- 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
171+
<!-- 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
172172
<LoggerRunSettings>
173173
<Loggers>
174174
<Logger friendlyName="console" enabled="True">
@@ -247,5 +247,9 @@ Included items must then not match any entries in the exclude list to remain inc
247247
<DiscoveryMethod>Current</DiscoveryMethod>
248248
<!--Legacy or Current-->
249249
<AssemblySelectLimit>2000</AssemblySelectLimit>
250+
<NewOutputXmlFileForEachRun>false</NewOutputXmlFileForEachRun>
251+
<IncludeStackTraceForSuites>true</IncludeStackTraceForSuites>
252+
<ExplicitMode>Strict</ExplicitMode>
253+
<SkipExecutionWhenNoTests>false</SkipExecutionWhenNoTests>
250254
</NUnit>
251255
</RunSettings>
74 Bytes
Binary file not shown.

ItemTemplates/AllRunSettings.zip

77 Bytes
Binary file not shown.
74 Bytes
Binary file not shown.

ItemTemplates/parallel.zip

79 Bytes
Binary file not shown.
Lines changed: 92 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,61 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<!-- For more information, see https://docs.microsoft.com/en-us/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file?view=vs-2019 -->
2+
<!-- For more information, see https://docs.microsoft.com/en-us/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file?view=vs-2022 -->
33

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

11-
<!-- Framework35 | [Framework40] | Framework45 -->
12-
<!--<TargetFrameworkVersion>Framework40</TargetFrameworkVersion>-->
11+
<!-- Framework35 | [Framework40] | Framework45 -->
12+
<!--<TargetFrameworkVersion>Framework40</TargetFrameworkVersion>-->
1313

14-
<!-- Path to Test Adapters -->
15-
<!--<TestAdaptersPaths>%SystemDrive%\Temp\foo;%SystemDrive%\Temp\bar</TestAdaptersPaths>-->
16-
<TreatTestAdapterErrorsAsWarnings>false</TreatTestAdapterErrorsAsWarnings>
14+
<!-- Path to Test Adapters -->
15+
<!--<TestAdaptersPaths>%SystemDrive%\Temp\foo;%SystemDrive%\Temp\bar</TestAdaptersPaths>-->
16+
<TreatTestAdapterErrorsAsWarnings>false</TreatTestAdapterErrorsAsWarnings>
1717

18-
<!-- Path relative to solution directory -->
19-
<ResultsDirectory>.\TestResults</ResultsDirectory>
18+
<!-- Path relative to solution directory -->
19+
<ResultsDirectory>.\TestResults</ResultsDirectory>
2020

21-
<!-- 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-->
22-
<MaxCpuCount>0</MaxCpuCount>
21+
<!-- 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-->
22+
<MaxCpuCount>0</MaxCpuCount>
2323

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

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

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

34-
<!-- Disables in-assembly parallel execution, applies to both MSTest and NUnit -->
35-
<DisableParallelization>false</DisableParallelization>
36-
<DisableAppDomain>false</DisableAppDomain>
37-
<CollectSourceInformation>true</CollectSourceInformation>
34+
<!-- Disables in-assembly parallel execution, applies to both MSTest and NUnit -->
35+
<DisableParallelization>false</DisableParallelization>
36+
<DisableAppDomain>false</DisableAppDomain>
37+
<CollectSourceInformation>true</CollectSourceInformation>
3838

39-
<!-- Runner related configuration -->
40-
<BatchSize>10</BatchSize>
39+
<!-- Runner related configuration -->
40+
<BatchSize>10</BatchSize>
4141

42-
</RunConfiguration>
42+
</RunConfiguration>
4343

44-
<!-- <DataCollectionRunSettings>
44+
<!-- <DataCollectionRunSettings>
4545
<DataCollectors> -->
46-
<!-- 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. -->
47-
<!-- <DataCollector friendlyName="blame" enabled="True">
46+
<!-- 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. -->
47+
<!-- See https://docs.microsoft.com/en-us/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file?view=vs-2022#blame-data-collector-->
48+
<!-- <DataCollector friendlyName="blame" enabled="True">
4849
</DataCollectors> -->
49-
<!-- </DataCollectionRunSettings> -->
50+
<!-- </DataCollectionRunSettings> -->
5051

51-
<!--
52+
<!--
5253
<TestRunParameters>
5354
<Parameter name="webAppUrl" value="http://localhost" />
5455
<Parameter name="webAppUserName" value="Admin" />
5556
</TestRunParameters> -->
5657

57-
<!-- 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
58+
<!-- 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
5859
<LoggerRunSettings>
5960
<Loggers>
6061
<Logger friendlyName="console" enabled="True">
@@ -77,62 +78,67 @@
7778
-->
7879

7980

80-
<!-- Adapter Specific sections -->
81+
<!-- Adapter Specific sections -->
8182

82-
<!-- MSTest adapter -->
83-
<MSTest>
84-
<MapInconclusiveToFailed>false</MapInconclusiveToFailed>
85-
<CaptureTraceOutput>true</CaptureTraceOutput>
86-
<DeleteDeploymentDirectoryAfterTestRunIsComplete>true</DeleteDeploymentDirectoryAfterTestRunIsComplete>
87-
<DeploymentEnabled>true</DeploymentEnabled>
88-
<DeployTestSourceDependencies>true</DeployTestSourceDependencies>
89-
<MapNotRunnableToFailed>false</MapNotRunnableToFailed>
90-
<EnableBaseClassTestMethodsFromOtherAssemblies>false</EnableBaseClassTestMethodsFromOtherAssemblies>
91-
<!-- <TestTimeout>5000</TestTimeout> -->
83+
<!-- MSTest adapter -->
84+
<MSTest>
85+
<MapInconclusiveToFailed>false</MapInconclusiveToFailed>
86+
<CaptureTraceOutput>true</CaptureTraceOutput>
87+
<DeleteDeploymentDirectoryAfterTestRunIsComplete>true</DeleteDeploymentDirectoryAfterTestRunIsComplete>
88+
<DeploymentEnabled>true</DeploymentEnabled>
89+
<DeployTestSourceDependencies>true</DeployTestSourceDependencies>
90+
<MapNotRunnableToFailed>false</MapNotRunnableToFailed>
91+
<EnableBaseClassTestMethodsFromOtherAssemblies>false</EnableBaseClassTestMethodsFromOtherAssemblies>
92+
<!-- <TestTimeout>5000</TestTimeout> -->
9293

93-
<!-- Uncomment and update path for assembly resolution -->
94-
<!-- <AssemblyResolution>
94+
<!-- Uncomment and update path for assembly resolution -->
95+
<!-- <AssemblyResolution>
9596
<Directory path="D:\myfolder\bin\" includeSubDirectories="false"/>
9697
</AssemblyResolution> -->
97-
<ForcedLegacyMode>false</ForcedLegacyMode>
98-
<!--
98+
<ForcedLegacyMode>false</ForcedLegacyMode>
99+
<!--
99100
<SettingsFile>a .testsettings file (require ForcedLegacyMode true) </SettingsFile>
100101
-->
101-
</MSTest>
102-
103-
<!-- NUnit3 adapter, uncomment sections to set as appropriate, numeric, booleans, enums have their default values below, except RandomSeed -->
104-
<!-- For documentation, see https://docs.nunit.org/articles/vs-test-adapter/Tips-And-Tricks.html -->
105-
<NUnit>
106-
<!--<BasePath>D:\Dev\NUnit\nunit3-vs-adapter\demo\NUnitTestDemo\bin\Release</BasePath>-->
107-
<!--<PrivateBinPath>extras;more.extras</PrivateBinPath>-->
108-
<DefaultTimeout>0</DefaultTimeout>
109-
<!--<WorkDirectory>work</WorkDirectory>-->
110-
<InternalTraceLevel>Off</InternalTraceLevel>
111-
<!--<RandomSeed>1234567</RandomSeed>-->
112-
<NumberOfTestWorkers>-1</NumberOfTestWorkers>
113-
<Verbosity>0</Verbosity>
114-
<!--<UseVsKeepEngineRunning>false</UseVsKeepEngineRunning>-->
115-
<!--<ShadowCopyFiles>false</ShadowCopyFiles>-->
116-
<!--<DefaultTestNamePattern>{m}{a}</DefaultTestNamePattern>-->
117-
<!--<DomainUsage>Single</DomainUsage>-->
118-
<DumpXmlTestDiscovery>false</DumpXmlTestDiscovery>
119-
<DumpXmlTestResults>false</DumpXmlTestResults>
120-
<ShowInternalProperties>false</ShowInternalProperties>
121-
<!--<TestOutputXml>TestOutputXml</TestOutputXml>-->
122-
<!--<Where></Where>-->
123-
<!-- NUnit filter expression, see https://docs.nunit.org/articles/nunit/running-tests/Test-Selection-Language.html -->
124-
<ConsoleOut>1</ConsoleOut>
125-
<UseTestNameInConsoleOutput>true</UseTestNameInConsoleOutput>
126-
<StopOnError>false</StopOnError>
127-
<SkipNonTestAssemblies>false</SkipNonTestAssemblies>
128-
<MapWarningTo>Skipped</MapWarningTo>
129-
<!--Passed, Failed or Skipped-->
130-
<DisplayName>Name</DisplayName>
131-
<!--Name, FullName or FullNameSep-->
132-
<FullnameSeparator>:</FullnameSeparator>
133-
<DiscoveryMethod>Current</DiscoveryMethod>
134-
<!--Legacy or Current-->
135-
<AssemblySelectLimit>2000</AssemblySelectLimit>
136-
</NUnit>
102+
</MSTest>
103+
104+
<!-- NUnit3 adapter, uncomment sections to set as appropriate, numeric, booleans, enums have their default values below, except RandomSeed -->
105+
<!-- For documentation, see https://docs.nunit.org/articles/vs-test-adapter/Tips-And-Tricks.html -->
106+
<NUnit>
107+
<!--<BasePath>D:\Dev\NUnit\nunit3-vs-adapter\demo\NUnitTestDemo\bin\Release</BasePath>-->
108+
<!--<PrivateBinPath>extras;more.extras</PrivateBinPath>-->
109+
<DefaultTimeout>0</DefaultTimeout>
110+
<!--<WorkDirectory>work</WorkDirectory>-->
111+
<InternalTraceLevel>Off</InternalTraceLevel>
112+
<!--<RandomSeed>1234567</RandomSeed>-->
113+
<NumberOfTestWorkers>-1</NumberOfTestWorkers>
114+
<Verbosity>0</Verbosity>
115+
<!--<UseVsKeepEngineRunning>false</UseVsKeepEngineRunning>-->
116+
<!--<ShadowCopyFiles>false</ShadowCopyFiles>-->
117+
<!--<DefaultTestNamePattern>{m}{a}</DefaultTestNamePattern>-->
118+
<!--<DomainUsage>Single</DomainUsage>-->
119+
<DumpXmlTestDiscovery>false</DumpXmlTestDiscovery>
120+
<DumpXmlTestResults>false</DumpXmlTestResults>
121+
<ShowInternalProperties>false</ShowInternalProperties>
122+
<!--<TestOutputXml>TestOutputXml</TestOutputXml>-->
123+
<!--<Where></Where>-->
124+
<!-- NUnit filter expression, see https://docs.nunit.org/articles/nunit/running-tests/Test-Selection-Language.html -->
125+
<ConsoleOut>1</ConsoleOut>
126+
<UseTestNameInConsoleOutput>true</UseTestNameInConsoleOutput>
127+
<StopOnError>false</StopOnError>
128+
<SkipNonTestAssemblies>false</SkipNonTestAssemblies>
129+
<MapWarningTo>Skipped</MapWarningTo>
130+
<!--Passed, Failed or Skipped-->
131+
<DisplayName>Name</DisplayName>
132+
<!--Name, FullName or FullNameSep-->
133+
<FullnameSeparator>:</FullnameSeparator>
134+
<DiscoveryMethod>Current</DiscoveryMethod>
135+
<!--Legacy or Current-->
136+
<AssemblySelectLimit>2000</AssemblySelectLimit>
137+
<NewOutputXmlFileForEachRun>false</NewOutputXmlFileForEachRun>
138+
<IncludeStackTraceForSuites>true</IncludeStackTraceForSuites>
139+
<ExplicitMode>Strict</ExplicitMode>
140+
<SkipExecutionWhenNoTests>false</SkipExecutionWhenNoTests>
141+
142+
</NUnit>
137143
</RunSettings>
138144

ParallelTemplate/parallel.zip

79 Bytes
Binary file not shown.

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
### RunSettings for "real" developers who write unit tests
2-
A set of runsettings item templates for Visual Studio 2019 and 2017. [For earlier versions see the links below]
2+
A set of runsettings item templates for Visual Studio 2022, 2019 and 2017. [For earlier versions see the links below]
33

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

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

9-
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).
9+
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).
1010

1111
### How to use
1212
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.
@@ -21,8 +21,8 @@ This template automates the creation of the default runsettings under solution i
2121
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. 
2222

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

2727
Enjoy!
2828

@@ -34,6 +34,8 @@ More information on [NUnit parallel execution](https://github.com/nunit/docs/wik
3434
### Templates
3535
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.
3636

37+
To enable automatic running of the runsettings file, rename the one you choose to **.runsettings**.
38+
3739
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/) 
3840

3941
### Why are there no settings for XUnit included

0 commit comments

Comments
 (0)