Generates pytest test-cases for Python programs.
More...
#include <pytest.h>
|
| static std::string | extract_module_name (const std::string &input_file) |
| | Extract module name from input file path and removes .py extension and directory.
|
| static std::string | generate_pytest_filename (const std::string &module_name) |
| | Generate pytest filename from module name.
|
|
| static constexpr const char * | default_output_dir = "esbmc-pytest" |
| | Default directory for –generate-pytest-testcase output, overridable with –pytest-output-dir (github #6220).
|
Generates pytest test-cases for Python programs.
◆ pytest_generator()
| pytest_generator::pytest_generator |
( |
| ) |
|
|
default |
◆ clear()
| void pytest_generator::clear |
( |
| ) |
|
Clear collected data (called at start of coverage run).
◆ collect()
Collect test data from a counterexample (called for each CEX in coverage mode).
◆ extract_module_name()
| std::string pytest_generator::extract_module_name |
( |
const std::string & | input_file | ) |
|
|
static |
Extract module name from input file path and removes .py extension and directory.
◆ generate()
| void pytest_generator::generate |
( |
const std::string & | output_dir, |
|
|
const std::string & | file_name ) const |
Generate pytest file from collected data (called at end of coverage mode).
file_name is the bare filename (e.g. "test_foo.py"); the file is written to output_dir/file_name (github #6220).
◆ generate_pytest_filename()
| std::string pytest_generator::generate_pytest_filename |
( |
const std::string & | module_name | ) |
|
|
static |
Generate pytest filename from module name.
◆ generate_single()
◆ has_tests()
| bool pytest_generator::has_tests |
( |
| ) |
const |
Check if any test cases have been collected.
◆ set_values_only()
| void pytest_generator::set_values_only |
( |
bool | enabled | ) |
|
|
inline |
Single-shot generation for non-coverage mode.
file_name is the bare filename; the file is written to output_dir/file_name (github #6220). Selects the values-only output (see –pytest-values-only).
◆ default_output_dir
| const char* pytest_generator::default_output_dir = "esbmc-pytest" |
|
staticconstexpr |
Default directory for –generate-pytest-testcase output, overridable with –pytest-output-dir (github #6220).
The documentation for this class was generated from the following files: