Skip to content
| Marketplace
Sign in
Visual Studio Code>Testing>Canatata Test Script GenerationNew to Visual Studio Code? Get it now.
Canatata Test Script Generation

Canatata Test Script Generation

QA Systems GmbH

|
54 installs
| (0) | Free
Generate Cantata Tests for your C/C++ code
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Cantata Test Script Generation for Visual Studio Code

Cantata is a unit and integration testing tool for C and C++.

This extension provides creation of Cantata test scripts from within VS code, including extensive configurability.

A screenshot of the Call Interface Control tab in the Test Script Generation view

Table of Contents

  • Table of Contents
  • Features
  • Requirements
  • Provided Visual Studio Code Commands
  • Provided Visual Studio Code Menu Entries
  • Provided Visual Studio Code Views
  • Known Issues
  • Release Notes

Features

  • Open the test script configuration view to begin configuring your new test script
  • Pick which source files to test within the view
  • Choose a script name and other basic settings from the main configuration tab
  • Switch tabs to find detailed controls for things like stubs and wrappers
  • Even more control over the test script can be found in the extension settings

Requirements

A licensed installation of Cantata 26.01 or later is required to generate test scripts inside Visual Studio code.

A free trial of Cantata is available on the QA Systems website.

Provided Visual Studio Code Commands

One command is provided to set up the extension:

  • Cantata: Configure Build Commands File Location
    In order to generate tests for source files, Cantata must obtain information about the source files. To do this, it needs to know how to compile the files. Compile information can be provided through a build commands file, allowing Cantata to automatically generate the data (.csi files) it needs.
    Use this command to select the file (typically called 'build_commands.json' or 'compile_commands.json') that contains compile information for the source files you will be testing. See the Cantata documentation for information on how to use the cppbch tool to generate this file, or for other ways to produce the required .csi data.

Two commands are provided to open the test script configuration view:

  • Cantata: Open Testscript Generator
    This will open the test script configuration view with no source files pre-loaded.
    Use the add source file button, or hold shift while dragging a source file from the explorer view to add files to be tested.
  • Cantata: Generate Test Script
    This will open the test script configuration view with the active editor's source file pre-loaded.
    More source files can be selected as described above.

Provided Visual Studio Code Menu Entries

  • Cantata: Generate Test Script
    This menu entry behaves the same as the command described above.
    It is available when right-clicking a source file in the Explorer view. The test configuration view is automatically populated with the file selected in the explorer.
    It is available when right-clicking within a source file displayed in the editor view. The test configuration view is automatically populated with the file open in the editor.
  • Cantata: Add file(s) to Test Script Generator Available when right-clicking a source file in the Explorer view or inside the code editor, if the Generate Test Script view is already open. This will add the selected source file to the list of files to test, if not already present.

Provided Visual Studio Code Views

  • Cantata Test Script Configuration View
    This view allows setting of the options for a Cantata test script.
    • Files selected for testing are listed on the left. It is recommended that these are selected before continuing to set other options, as some options' values and applicability depends on the files selected.
    • A base directory for the tests can be specified at the top. In many cases, this can be pre-selected for you, but may be modified if desired. This base directory will contain the project-level options file for the tests and, if using Cantata makefiles, will contain the Cantata tests directory.
    • Basic settings such as the script name and coverage rule set can be selected on the first tab.
    • Where testing C++ code that contains abstract classes, the second tab may be used to create concrete, testable subclasses for use in the test script.
    • The third tab provides control over call interfaces using stubs, wrappers and isolates. Search and bulk edit features allow you to quickly find and control the functions you need.
    • Further options, available within the VS Code settings view, may affect the settings and the test generated. Each setting and its effect is described within the settings view.

Known Issues

  • Modifying the content of selected SUT files after adding them to the view, but before generating the test, may cause test generation to fail.

Release Notes

1.0.0

Initial release of the extension.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft