pytest plugin for toffee testing
Project description
toffee-test
toffee-test is a pytest plugin that provides testing support for the toffee framework. It includes several features to assist users in writing test cases for toffee:
- Identifies test functions as toffee test case objects, making them recognizable and executable by the toffee framework
- Offers resource management for test cases, such as DUT creation and destruction
- Provides test report generation
Usage
Installation
-
Properly install toffee and its dependencies.
-
Install toffee-test
To install toffee-test via pip:
pip install toffee-test
Or install the development version:
pip install toffee-test@git+https://github.com/XS-MLVP/toffee-test@master
Or install from source:
git clone https://github.com/XS-MLVP/toffee-test.git
cd toffee-test
pip3 install .
Usage
Managing Test Case Resources
toffee-test provides the toffee_request
fixture for managing test case resources. Use toffee_request
to create your own fixture, which can then be used within test cases.
For example, the following code creates a fixture to manage DUT creation and destruction.
import toffee_test
@toffee_test.fixture
def my_fixture(toffee_request: toffee_test.ToffeeRequest):
return toffee_request.create_dut(MyDUT, "clock_pin_name")
Interfaces provided in toffee_request
include:
create_dut
: Creates a DUTdut_cls
: DUT classclock_name
: Clock namewaveform_filename
: Waveform file namecoverage_filename
: Coverage file name
add_cov_groups
: Adds coverage groupscov_groups
: Coverage groupsperiodic_sample
: Periodic sampling option
Marking Test Cases
Use the @toffee_test.testcase
decorator to mark test functions, making them recognizable and executable by the toffee framework.
Generating Test Reports
By adding the --toffee-report
parameter to the pytest command line, you can generate a toffee test report.
Additionally, the --report-name
parameter can specify the report name, and --report-dir
can specify the report directory.
Additional Resources
More resources are available at toffee and Open Verify.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for toffee_test-0.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa7112c87e21a4745583da1240359e77ca8fd2a59eb0c77c6b2ab4b2787887b5 |
|
MD5 | e1a09f2b6dbefba3e81e601738769d8c |
|
BLAKE2b-256 | a71a410975c71976e42319951aab13fbe59207a791a94195bb261c1648b0b8f1 |