/VUnit-by-HGB

VUnit-by-HGB is a VS-Code extension which enables the testexplorer for VUnit projects.

Primary LanguageTypeScriptGNU General Public License v3.0GPL-3.0

VUnitByHGB

VUnitByHGB is a Visual Studio Code extension that makes it easy to debug and run VUnit testcases from the sidebar of VS-Code. This Extension is maintained by Jakob Jungreuthmayer at University of Applied Sciences Upper Austria - Campus Hagenberg.

Features

  • List all VUnit testcases from multiple run.py scripts
  • Run VUnit testcases
  • Debug VUnit testcases in GUI mode
  • Go-To-Source: Jump to the run script
  • Go-To-Testcase: Jump to the implementation of a testcase
  • Highlight failed/passed testcases
  • Highlight failed assertions
  • Parallel execution of testcases

UI example

Usage

  1. Make sure that VUnit is installed (e.g. using pip install vunit_hdl)
  2. Open a folder that contains a run.py script
  3. Open any VHDL or python file to activate the extension
  4. Open the Testing-SideViewContainer on the left menu bar
  5. All Testcases should be displayed. From here, you can:
    • Press the run button to run a unit test in background
    • Press the debug button to run a test in GUI mode
    • Jump to the definition of a testcase

History

This Visual Studio Code extension is a fork of VUnit Test Explorer by Henrik Bohlin, was no longer maintained. In 2023, Jakob Jungreuthmayer made the following major changes during his bachelor`s degree at University of Applied Sciences Upper Austria - Campus Hagenberg:

  • Ported to the official VS-Code-Testing-API
  • Added support for multiple run.py scripts in the workspace
  • Added problem matchers for Python and Modelsim/Questasim output

Contributing

Contributing in the form of code, documentation, feedback, tutorial, ideas or bug reports is very welcome.

Maintainers:

Configuration

The following configuration properties are available:

Property Description
vunit-by-hgb.scriptname consistent name of all VUnit-run-scripts (default: run.py)
vunit-by-hgb.python Path to python executable.
vunit-by-hgb.shellOptions VUnit run.py command line options when running tests.
vunit-by-hgb.guiOptions VUnit run.py command line options when running GUI (-g should not be added here).
vunit-by-hgb.exportJsonOptions VUnit run.py command line options when discovering test with --export-json.
vunit-by-hgb.showExecutionTime Display Execution-Time for every testcase
vunit-by-hgb.executeMultipleGuiTestcases Executing multiple GUI-Testcases at once
vunit-by-hgb.matchProblems Display Errors and Warnings from VUnit as Problems
vunit-by-hgb.matchAssertionFailure Display Assertion-Failures from VUnit as Problems

Related Projects

  • HDLRegression is an alternative to VUnit. Use HDLRegressionByHGB to run HDLRegression tests from the VS-Code sidebar. (currently under development)

License

This extension is published under the GNU GPL license.