Run Tests
This project uses the PyTest testing framework for verification. When running tests, the PyTest framework automatically searches for all test_*.py
files and executes all test cases that start with test_
.
# Run all test cases in ut_* directories
make test_all
# Run test cases in the specified directory
make test target=<dir>
# For example, run all test cases in the ut_backend/ctrl_block/decode directory
make test target=ut_backend/ctrl_block/decode
You can pass Pytest runtime parameters via the args
parameter, such as enabling the x-dist plugin for multi-core execution:
make test args="-n 4" # Use 4 processes
make test args="-n auto" # Let the framework automatically choose the number of processes
*Note: x-dist can run tests concurrently on multiple nodes. See its documentation for details.
After running, an HTML version of the test report will be generated by default in the out/report
directory. The HTML file can be opened directly in a browser (it is recommended to install the Open In Default Browser
plugin in VS Code IDE).
Running tests mainly completes the following three parts:
- Run Test Cases as required, which can be configured via options in
cfg.tests
- Collect test results and output test reports. The toffee-report tool automatically generates (a total test report, merging results of all tests)
- Further data statistics on the test report as needed (
cfg.doc_result.disable = True
)