Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

C++ TestMate - Visual Studio Marketplace

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4
At a glance
Powered by AI
The extension allows running Catch2, Google Test and DOCtest tests from VSCode. It also has basic support for Google Benchmark and provides features like reloading tests when recompiled, running tests in parallel, and cooperating with debuggers and other extensions.

Features include reloading test lists when recompiled, running tests in parallel, automatic rerunning when dependencies change, customizing grouping, colorizing output, and more as described on pages 1 and 2.

Configuration options are available under test.executables, test.advancedExecutables, and other settings as described on page 2. Options include setting the glob pattern to find tests, working directories, runtime limits, caching, and more.

| Marketplace Sign in

Visual Studio Code > Other > C++ TestMate New to Visual Stud

C++ TestMate
Mate Pek |  60,810 installs | (10) | Free

Run GoogleTest, Catch2 and DOCtest tests from VSCode and VSCodium

Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.

ext install matepek.vscode-catch2-test-adapter Copy More Info

Overview Version History Q&A Rating & Review

C++ TestMate Categories


Other

A Catch2, GoogleTest, doctest and GoogleBenchmark Explorer for VSCode Tags


c++ catch2 catchorg doctest gbenchm
version v 3 . 6 . 2 6 issues 5 open downloads 405k chat on gitter
gmock google benchmark google mock

This extension allows you to run your Catch2, Google Test and DOCtest tests using the Test Explorer for Visual google test googlemock googletest gtest
Studio Code. It also have basic support for Google Benchmark.
onqtam test testing testmate

testMate.cpp.testOutput unit test


Features / Show-Off

Reloads test list of an executable if it is recompiled. (Hint: Right click -> Enable Autorun) Resources
Runs executables parallel (testMate.cpp.test.parallelExecutionLimit). Issues
Sorts tests and suites (testExplorer.sort). Repository
Supports popular debuggers such as vadimcn.vscode-lldb, webfreak.debug and ms- Homepage
vscode.cpptools out of the box. License
Changelog
Screenshots Download Extension

Project Details
 matepek/vscode-catch2-test-adapter
 No Pull Requests
 Last Commit: 2 weeks ago
 5 Open Issues

More Info
Version 3.6.26
Released on 25/08/2018 à 22:28:00

Last updated 27/04/2021 à 00:19:50


Publisher Mate Pek
Unique Identifier matepek.vscode-catch2-test-adapte

Report Report Abuse

More features
One executable can be run parallel with distinct set of subtests to boost runtime.
Finds and recognises the executables by a given glob pattern. (More)
Automatically runs executables if it is modified ("..." -> "Enable autorun") or if a dependency is modified
(dependsOn)
Cooperates with other extensions like:
Test Explorer Status Bar
Test Explorer Live Share
Grouping can be fully customized. (Details)
Colorizes output window. (This might conflict with other output colorizer extensions, it's a vscode limitation.)
and many more.. Ask on gitter.

Configuration

The extension is *pre-configured and it should find executables inside the working directory which match the
following glob pattern: Not good enough for you?!: Edit your .vscode/settings.json file according to the
test.advancedExecutables!

testMate.cpp.___ Description

A glob pattern to find test executables. (R


workspace folder or absolute path.) Empty
means disabled. For more option set
test.executables testMate.cpp.test.advancedExecutables in
NOTE: if
testMate.cpp.test.advancedExecu
set then this is ignored.

Array of executables with a lot of options.


test.advancedExecutables then testMate.cpp.test.executabl
ignored.) (Details).

Sets the working directory of the test exec


test.workingDirectory (relative to the workspace folder or absolu
Note: testMate.cpp.advancedExecu
overwrites it locally. (Variables)

Shuffles the tests with the given random.


test.randomGeneratorSeed rng-seed ( or 'time'); Google Test: --
gtest_random_seed=;

[seconds] Test executable is running in a p


test.runtimeLimit case of an infinite loop it will run forever u
parameter is set. It applies instantly. (0 me

Maximizes the number of the parallel test


test.parallelExecutionLimit (It applies instantly.) Note: If your executa
on the same resource exclusively then thi
cause a problem.

Maximizes the number of the parallel exec


executables. To enable this just for specific
use the
testMate.cpp.test.advancedExecu
test.parallelExecutionOfExecutableLimit parallelizationLimit. The
testMate.cpp.test.parallelExecu
is a global limit and this is a local one. No
test cases depend on the same resource e
then this could cause a problem.

[seconds] Test executables are being watc


discovery.gracePeriodForMissing inside the workspace directory). In case of
recompiles it will try to preserve the test s
compilation reaches timeout it will drop th

discovery.runtimeLimit [seconds] The timeout of the test-executa


identify it (Calls the exec with --help).

(Experimental) In case your executable too


time to list the tests, one can set this. It wi
discovery.testListCaching the output of --gtest_list_tests -
gtest_output=xml:.... (Beware: Olde
Test doesn't support xml test list format.)
testMate.cpp.___ Description

Test loading fails if one of the files matche


discovery.strictPattern test.executable is not a test executab
noticing unexpected crashes/problems un
loading.)

Sets the necessary debug configurations a


debug.configTemplate
debug button will work.

debug.breakOnFailure Debugger breaks on failure while debugg


Catch2: --break; Google Test: --gtest_brea

Skips all assertions that test that an excep


debug.noThrow thrown, e.g. REQUIRE_THROWS. This is a C
parameter: --nothrow;

Creates a new output channel and write th


log.logpanel messages there. For debugging. Enabling
down your vscode.

log.logfile Writes the log message into the given file


means disabled.

Forces the test to be failed even it is passe


gtest.treatGmockWarningAs contains the string GMOCK_WARNING:. (Yo
should consider using testing::StrictMock)

gtest.gmockVerbose Sets --gmock_verbose=.... (Note: executab


linked to gmock gmock_main not gtest

Plenty of more fine-tuning options are available under test.advancedExecutables like:

test grouping
parallel running
ingoring std error
...

Test Explorer's configurations

This extension is built upon the Test Explorer so its configuration and commands can be used:

testExplorer.___ Description
onStart Retire or reset all test states whenever a test run is started
onReload Retire or reset all test states whenever the test tree is reloaded

codeLens Show a CodeLens above each test or suite for running or


debugging the tests

gutterDecoration Show the state of each test in the editor using Gutter
Decorations

errorDecoration Show error messages from test failures as decorations in the


editor
errorDecorationHover Provide hover messages for the error decorations in the editor

Sort the tests and suites by label or location. If this is not set
sort (or set to null), they will be shown in the order that they were
received from the adapter
showCollapseButton Show a button for collapsing the nodes of the test tree

showExpandButton Show a button for expanding the top nodes of the test tree,
recursively for the given number of levels
showOnRun Switch to the Test Explorer view whenever a test run is started

addToEditorContextMenu Add menu items for running and debugging the tests in the
current file to the editor context menu
mergeSuites Merge suites with the same label and parent

hideEmptyLog Hide the output channel used to show a test's log when the
user clicks on a test whose log is empty

Hide the Test Explorer when no test adapters have been


hideWhen registered or when no tests have been found by the registered
adapters. The default is to never hide the Test Explorer (some
test adapters only work with this default setting).
Use these commands in your tasks.json like

{
"label": "Activate Test Explorer",
"type": "shell",
"command": "echo ${command:test-explorer.reload}",
"problemMatcher": [],
"runOptions": {
"runOn": "folderOpen" // This will cause the triggering. Have to run manually once!
}
}

ID Command
test-explorer.reload Reload tests
test-explorer.run-all Run all tests
test-explorer.run-file Run tests in current file

test-explorer.run-test-at-cursor Run the test at the current cursor position


test-explorer.rerun Repeat the last test run
test-explorer.debug-test-at-cursor Debug the test at the current cursor position
test-explorer.redebug Repeat the last test run in the debugger
test-explorer.cancel Cancel running tests

And more at Test Explorer homepage.

About Sentry.io integration

License

Support

Contribution

Contact us Jobs Privacy Terms of use T

© 2021 Microsoft

You might also like