Cantata Results Extension for Visual Studio Code
Cantata is a unit and integration testing tool for C and C++.
This extension allows Cantata makefile tests to be run directly from Visual Studio Code's Testing view, and the results to be displayed within various parts of the Visual Studio Code testing framework.
Table of Contents
- Provided Visual Studio Code Commands
- Known Issues
- Release Notes
- Switch to the testing view or use the 'Cantata: Show Testing View' action to display Cantata tests.
- Test scripts and their test cases are displayed within the Testing tree view.
- Use the appropriate run buttons in the Testing tree to run individual test scripts, complete projects, or all tests currently loaded into the Visual Studio Code workspace.
- Results from test runs, including actual and expected values, are displayed within the Testing tree, inline in the test code, and in other parts of the Visual Studio Code testing framework.
A licensed installation of Cantata 22.10 Update 3 or later is required to display test results inside Visual Studio code.
The extension can be installed and loaded, and tests can be run without the above Cantata installation. However, results display will not be available. A warning notification will be displayed if this is the case.
A free trial of Cantata is available on the QA Systems website.
Provided Visual Studio Code Commands
This extension introduces one new command for use within the Command Palette:
- Cantata: Show Testing View
This command will cause the testing view to be displayed.
The testing view, as well as other views, can also be selected from the left sidebar within the main window.
At the time of writing, the testing view can be identified by the conical flask icon.
If the test explorer does not exist or cannot be displayed, a notification will be shown with further information.
The current release has the following known limitations:
- Tests are run in a non-interactive console and it is therefore not possible to record or display results from the
- At the time of release, the default Visual Studio Code test results framework has only a boolean state for whether a test passed, but no concept of a warning. This may be extended in the future. Cantata test warnings are therefore registered as passes. If the display of test warnings is required, please check the CTR file or use the Eclipse plug-ins.
- Only projects using the standard Cantata makefiles project structure are supported for running directly from the Visual Studio Code Testing view. Other project structures can be managed by setting up a Visual Studio Code run configuration as described in the 'Use with VS Code' Technical Note, available from a QA Systems representitive. As displayed results are associated with a run initiated from the Visual Studio Code Testing framework, it is also not possible to display test results from alternate project structures.
- VS code detects test cases by the presence of the
START_TEST directive. Therefore, if this is hidden through use of a macro, or another directive, such as
START_TEST_LOOP, the test case results will not be displayed. Support for looping tests is scheduled for inclusion in an upcoming release.
Initial release of this extension, including functionality for running makefile tests Version 1 of the extension provides initial generation of test items on the test explorer from existing test scripts in the opened project and features to run Cantata tests.