Skip to content

Commit

Permalink
Prepare release 1.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnnyHendriks committed Jan 29, 2022
1 parent 18a65be commit 2b0293d
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 12 deletions.
12 changes: 12 additions & 0 deletions Docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

Changes are relative to v1.0.0

## Changes for v1.8.0

This version introduces support for Catch2 v3, which has a small change in xml-reporting format and has improved support for test discovery.

### New Features

- Add support for Catch2 v3 (issue #52)

### Extended Features

- Enable support for environmental variables when running in debug mode.

## Changes for v1.7.0

### New Features
Expand Down
10 changes: 6 additions & 4 deletions Docs/Discovery.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Introduction

One of the most important jobs of the **Test Adapter for Catch2** is to discover Catch2 test cases. Of course the [default discovery mechanisms](#default-discovery-mechanisms) that come out of the box with Catch2 are supported. However, there is also support for a [custom discovery mechanism](#custom-testcase-discovery).
One of the most important jobs of the **Test Adapter for Catch2** is to discover Catch2 test cases. Of course the [default discovery mechanisms](#default-discovery-mechanisms) that come out of the box with Catch2 are supported. However, there is also support for a [custom discovery mechanism](#custom-testcase-discovery). Note, that use of duplicate testcase names results in discovery failure, and an appropriate warning will be logged. In Catch2 v3 it is possible to have identical testcase names as long as the tags are different. However, the test explorer in Visual Studio is not able to deal with this. In this case the name of the duplicate testcase names will be modified (_e.g._, prepended with `[[DUPLICATE 1>>`), so it is clear which testcases have this problem. When those tests are run they will be skipped/fail.

## The discovery process

Expand All @@ -24,13 +24,15 @@ This is a very important step. Typically the **Test Adapter for Catch2** is prov
The **Test Adapter for Catch2** supports three different discovery mechanisms:

- `--list-tests` based (default setting)
- `--list-test-names-only` based
- `--list-test-names-only` based (not recommended, and removed in Catch2 v3)
- custom (xml based)

As of version 1.5.0 of the **Test Adapter for Catch2**, support for the Catch2 discovery command line options in combination with the `--verbosity high` option was added. Adding the latter option allows discovery of information about the source file and line number the testcase can be found at. The `--verbosity high` option was added to the default setting as of version 1.5.0 of the **Test Adapter for Catch2** as it is supported by Catch2 version 2.0.1 and up.

Before version 1.5.0 the default was not able to retrieve information about the source file and line number the testcase could be found at. This is basically the reason that the **Test Adapter for Catch2** has support for a [custom discovery mechanism](#custom-testcase-discovery), which is explained below.

As of version 1.8.0 of the **Test Adapter for Catch2**, support for the Catch2 v3 capability to set a reporter for discovery is supported. More specifically the output generated by the `xml` reporter in combination with `--list-tests`. This effectively removes the need for the custom discovery option, when Catch2 v3 is used.

As discovery of testcases requires the provided executable to be run, there is a chance that for whatever reason the executable does not stop automatically after it is run. Maybe it accidentally passed the filename filter in [step 1](#step1-filename-based-filter), and it is actually a process that runs forever. For this reason you can configure a [`<DiscoverTimeout>`](Settings.md#discovertimeout) that will kill the process if the discovery process takes longer than the set timeout. By default, this timeout is set to 1 second, which is typically more than enough.

### Step3: Extract testcases from output
Expand All @@ -49,11 +51,11 @@ This mechanism is used by default. It can discover both testcase names and tag n

### `--list-test-names-only`

This mechanism is only able to discover testcase names. It is however more robust in its ability to discover testcase names. Note however, that this discovery mechanism has been put on the Catch2 deprecation list.
This mechanism is only able to discover testcase names. It is however more robust in its ability to discover testcase names. Note however, that this discovery mechanism has been put on the Catch2 deprecation list and has been removed in Catch2 v3.

## Custom discovery mechanism

When custom discovery is used the output to be processed is expected to be Catch2 Xml (_i.e._, the same Xml used by the Catch2 xml reporter). Initially this was introduced to enable discovery of information about the source file and line number the testcase can be found at. I was unaware of the possibility to use the `--verbosity high` option to get this information and came up with this solution. As of version 1.5.0 of the **Test Adapter for Catch2** awareness was raised and the need for custom discovery is diminished. However, there may still be use cases for it, so the feature remains.
When custom discovery is used the output to be processed is expected to be Catch2 Xml (_i.e._, the same Xml used by the Catch2 xml reporter). Initially this was introduced to enable discovery of information about the source file and line number the testcase can be found at. I was unaware of the possibility to use the `--verbosity high` option to get this information and came up with this solution. As of version 1.5.0 of the **Test Adapter for Catch2** awareness was raised and the need for custom discovery is diminished. However, there may still be use cases for it, so the feature remains. Note, if you make use of Catch2 v3 there should be no need to make use of this feature.

### Requirements

Expand Down
18 changes: 12 additions & 6 deletions Docs/Settings.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Settings for Test Adapter for Catch2

> The information on this page is based on **Test Adapter for Catch2** v1.7.0.
> The information on this page is based on **Test Adapter for Catch2** v1.8.0.
In order for the **Test Adapter for Catch2** to do its job, it requires certain settings to be set explicitly by the user. This is done via a _.runsettings_ file. The settings for the **Test Adapter for Catch2** are collected inside the `<Catch2Adapter>` node that can be added to the `<RunSettings>` node of the _.runsettings_ file. Below is the list of settings that are available for the **Test Adapter for Catch2**. The ones with an asterisk are required to be set by the user and have defaults that will cause the **Test Adapter for Catch2** to not discovery tests.

Expand Down Expand Up @@ -35,9 +35,13 @@ The following _.runsettings_ file examples only contains settings specific to th
<Catch2Adapter>
<CombinedTimeout>60000</CombinedTimeout><!-- Milliseconds; Introduced in v1.6.0 -->
<DebugBreak>on</DebugBreak>
<DiscoverCommandLine>--verbosity high --list-tests *</DiscoverCommandLine>
<DiscoverCommandLine>--verbosity high --list-tests --reporter xml *</DiscoverCommandLine>
<DiscoverTimeout>500</DiscoverTimeout><!-- Milliseconds -->
<ExecutionMode>Combined</ExecutionMode><!-- Introduced in v1.6.0 -->
<Environment><!-- Introduced in v1.7.0 -->
<MyCustomEnvSetting>Welcome</MyCustomEnvSetting>
<MyOtherCustomEnvSetting value="debug&lt;0&gt;"/>
</Environment>
<ExecutionMode>Combine</ExecutionMode><!-- Introduced in v1.6.0 -->
<ExecutionModeForceSingleTagRgx>Slow</ExecutionModeForceSingleTagRgx><!-- Introduced in v1.6.0 -->
<FilenameFilter>^Catch_</FilenameFilter><!-- Regex filter -->
<IncludeHidden>true</IncludeHidden>
Expand Down Expand Up @@ -113,11 +117,13 @@ With the `<DebugBreak>` option you can turn on or off the break on test failure

## DiscoverCommandLine

Default: "--verbosity high --list-tests *"
Default: "--verbosity high --list-tests --reporter xml *"

With the `<DiscoverCommandLine>` option you set the commandline arguments to call a Catch2 executable with in order to discover the tests that are contained within the executable. You have the choice of the test discovery options that come out of the Catch2 box (`-l`, `--list-tests`, `--list-test-names-only`) or you can provide a custom one. The only requirement for the custom discoverer is that it generates Xml output according to the Catch2 xml reporter scheme. For the build in discovery options you can add filters to select only a subset of tests. For a custom discovery option, it is up to you if you want to support test filtering on this level. For a detailed description about the discovery process see the [discovery documentation page](Discovery.md) where you can also find a custom discovery example.

> Default value changed in v1.5.0
When you use Catch2 v3, you can set the reporter to xml for improved discovery. For previous version of Catch2 the setting had no effect on the discovery output.

> Default value changed in v1.5.0, and v1.8.0
## DiscoverTimeout

Expand Down Expand Up @@ -151,7 +157,7 @@ With the `<ExecutionMode>` option you can choose the way tests are executed.
| ExecutionMode | Description |
|:--------------|:------------|
| Single | For each test case a separate instance of the test executable is started. |
| Combined | A single test executable is started to run multiple test cases. |
| Combine | A single test executable is started to run multiple test cases. |
|||

> Introduced in v1.6.0
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The **Test Adapter for Catch2** is available via the [Visual Studio Marketplace]

## Documentation

For documentation on the **Test Adapter for Catch2** see the followng links.
For documentation on the **Test Adapter for Catch2** see the following links.

- [Overview](Docs/Readme.md)
- [Capabilities](Docs/Capabilities.md)
Expand Down
7 changes: 7 additions & 0 deletions VSIX/VSTestAdapterCatch2/RELEASENOTES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
Release Notes for v1.8.0 of the Test Adapter for Catch2
This version introduces support for Catch2 v3, which has a small change in xml-reporting format and has improved support for test discovery.
# New Features
- Add support for Catch2 v3
# Extended Features
- Enable support for environmental variables when running in debug mode.

Release Notes for v1.7.0 of the Test Adapter for Catch2
# New Features
- Add support for Visual Studio 2022.
Expand Down
2 changes: 1 addition & 1 deletion VSIX/VSTestAdapterCatch2/source.extension.vsixmanifest
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="VSTestAdapterCatch2.73ba8471-3771-47bf-bd23-49a1ba09af89" Version="1.7.3" Language="en-US" Publisher="Johnny Hendriks" />
<Identity Id="VSTestAdapterCatch2.73ba8471-3771-47bf-bd23-49a1ba09af89" Version="1.8.0" Language="en-US" Publisher="Johnny Hendriks" />
<DisplayName>Test Adapter for Catch2</DisplayName>
<Description xml:space="preserve">Test Adapter for use with the Catch2 C++ unit test framework.</Description>
<MoreInfo>https://github.com/JohnnyHendriks/TestAdapter_Catch2</MoreInfo>
Expand Down

0 comments on commit 2b0293d

Please sign in to comment.