Coder Social home page Coder Social logo

dpar39 / vscode-catch2-test-adapter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from matepek/vscode-catch2-test-adapter

0.0 0.0 0.0 7.91 MB

TAEF, Catch2, Google Test and doctest Adapter for VSCode

Home Page: https://marketplace.visualstudio.com/items?itemName=dpar39.vscode-taef-test-adapter

License: MIT License

Shell 18.41% JavaScript 0.34% C++ 3.11% TypeScript 76.47% CMake 1.67%
taef testing-tools

vscode-catch2-test-adapter's Introduction

C++ TAEFMate

A TAEF, Catch2, GoogleTest, doctest, and GoogleBenchmark Test Explorer for VSCode

This extension is a fork of vscode-catch2-test-adapter with added support for TAEF tests. If you don't need support for TAEF test execution and debugging, you should install the original extension.

Visual Studio Marketplace GitHub issues Visual Studio Marketplace

This extension allows you to run your TAEF, Catch2, Google Test and DOCtest tests using the native testing vscode-api. It also have basic support for Google Benchmark.

Features / Show-Off

  • New testing API integration has just happened with a tons of improvements.
    • Streaming the test run: Don't have to wait for the result to see the progress (in case you test uses std::cout)
    • Catch Section and DOCTest SubCase support (limited but still sometings)
  • Runs executables parallel (testMate.cpp.test.parallelExecutionLimit).
  • Sorts tests and suites (testExplorer.sort).
  • Supports popular debuggers such as vadimcn.vscode-lldb, webfreak.debug and ms-vscode.cpptools out of the box.
  • Retire tests and "Autorun" them.

Screenshots

Screenshot1

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)
  • Grouping can be fully customized. (Details)
  • and many more.. Ask on gitter.

The extension is pre-configured and it should find executables inside the working directory which match the following glob pattern:

{build,Build,BUILD,out,Out,OUT}/**/*{test,Test,TEST}*

Not good enough for you?!: Edit your .vscode/settings.json file according to the test.advancedExecutables!

testMate.cpp.___ Description
test.executables A glob pattern to find test executables. (Relative to the workspace folder or absolute path.) Empty string means disabled. For more option set testMate.cpp.test.advancedExecutables instead of this. NOTE: if testMate.cpp.test.advancedExecutables is set then this is ignored.
test.advancedExecutables Array of executables with a lot of options. (If this is set then testMate.cpp.test.executables is ignored.) (Details).
test.workingDirectory Sets the working directory of the test executable (relative to the workspace folder or absolute path). Note: testMate.cpp.advancedExecutables overwrites it locally. (Variables)
test.randomGeneratorSeed Shuffles the tests with the given random. Catch2: --rng-seed ( or 'time'); Google Test: --gtest_random_seed=;
test.runtimeLimit [seconds] Test executable is running in a process. In case of an infinite loop it will run forever unless this parameter is set. It applies instantly. (0 means infinite)
test.parallelExecutionLimit Maximizes the number of the parallel test executions. (It applies instantly.) Note: If your executables depend on the same resource exclusively then this could cause a problem.
test.parallelExecutionOfExecutableLimit Maximizes the number of the parallel execution of executables. To enable this just for specific executables use the testMate.cpp.test.advancedExecutables -> parallelizationLimit. The testMate.cpp.test.parallelExecutionLimit is a global limit and this is a local one. Note: If your test cases depend on the same resource exclusively then this could cause a problem.
discovery.loadOnStartup If true, the extension will try to load all the tests after the startup. Otherwise the user has to click on the Test icon on the sidebar to trigger the process.
discovery.gracePeriodForMissing [seconds] Test executables are being watched (only inside the workspace directory). In case of one recompiles it will try to preserve the test states. If compilation reaches timeout it will drop the suite.
discovery.runtimeLimit [seconds] The timeout of the test-executable used to identify it (Calls the exec with --help).
discovery.testListCaching In case your executable took too much time to list the tests, one can set this. It will preserve the output of --gtest_list_tests --gtest_output=xml:.... (Beware: Older Google Test doesn't support xml test list format.)
discovery.strictPattern Test loading fails if one of the files matched by test.executable is not a test executable. (Helps noticing unexpected crashes/problems under test loading.)
debug.configTemplate Sets the necessary debug configurations and the debug button will work.
debug.breakOnFailure Debugger breaks on failure while debugging the test. Catch2: --break; Google Test: --gtest_break_on_failure; Doctest: --no-breaks
debug.noThrow Skips all assertions that test that an exception is thrown, e.g. REQUIRE_THROWS. This is a Catch2 parameter: --nothrow;
log.logpanel Creates a new output channel and write the log messages there. For debugging. Enabling it could slow down your vscode.
log.logfile Writes the log message into the given file. Empty means disabled.
gtest.treatGmockWarningAs Forces the test to be failed even it is passed if it contains the string GMOCK_WARNING:. (You may should consider using testing::StrictMock)
gtest.gmockVerbose Sets --gmock_verbose=.... (Note: executable has to be linked to gmock gmock_main not gtest_main)
taef.teExecutablePath Custom executable path for TAEF's TE.exe. If left empty we try to find it in PATH environment variable.
taef.dbhExecutablePath Custom executable path to DBH.exe for finding test's source code location. If left empty we try to find it in PATH environment variable.

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

  • test grouping
  • parallel running
  • ingoring std error
  • ...

Commands

ID Command
testMate.cmd.reload-tests Reload tests
testMate.cmd.reload-workspaces Force reload workspaces (clean slate)
testing.refreshTests Force reload workspaces (clean slate)

vscode-catch2-test-adapter's People

Contributors

matepek avatar dpar39 avatar stefanhaller avatar tradias avatar bzarco avatar matt-deboer avatar appden avatar rurabori avatar novakov avatar sizasl avatar csk-ableton avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.