vvt#

class Directive(name: str, file: str, when: dict[str, str], options: list[tuple[str, Any]], argument: str, line: str, line_no: int)#

Bases: object

name: str#
file: str#
when: dict[str, str]#
options: list[tuple[str, Any]]#
argument: str#
line: str#
line_no: int#
class VVTestModel(root: str, path: str | None = None)#

Bases: PYTModel

class VVTestLockEmitter#

Bases: PYTLockEmitter

class VVTestLoader(*, file: Path)#

Bases: object

parse() list[Directive]#
class VVTestAdapter(model: VVTestModel)#

Bases: object

apply(directives: list[Directive]) None#
f_KEYWORDS(arg: Directive) None#
f_SOURCES(arg: Directive) None#
f_PRELOAD(arg: Directive) None#
f_PARAMETERIZE(arg: Directive) None#
f_ANALYZE(arg: Directive) None#
f_TIMEOUT(arg: Directive) None#
f_FILTER_WARNINGS(arg: Directive) None#
f_SKIPIF(arg: Directive) None#
f_BASELINE(arg: Directive) None#
f_ENABLE(arg: Directive) None#
f_NAME(arg: Directive) None#
f_DEPENDS_ON(arg: Directive) None#
csplit(text: str) list[Any]#
class TableToken(line: str, string: str, type: str)#

Bases: object

line: str#
string: str#
type: str#
NC: ClassVar[str] = '==NC=='#
NR: ClassVar[str] = '==NR=='#
WORD: ClassVar[str] = '==WORD=='#
popnext(arg: list[str]) str#
tokenize_table_text(table_text: str) Generator[TableToken, None, None]#

Split text into a table. Each row begins with a space and columns within the row are separated by a comma.

a,b,c  d,e,f -> [[a, b, c], [d, e, f]]

The splitting is complicated by accomodating spaces around the comma:

a , b,   c  d   ,e  ,  f -> [[a, b, c], [d, e, f]]

The following will also split properly:

a , "b , 0",   c  d   ,e  ,  f !-> [[a, 'b , 0', c], [d, e, f]]
make_table(text: str) list[list[str]]#
p_GEN_PARAMETERIZE(arg: Directive) tuple[list, list, dict, list | None]#

# VVT: parameterize ( OPTIONS,generator ) [:=] script [–options]

p_PARAMETERIZE(arg: Directive) tuple[list, list, dict, list | None]#

# VVT: parameterize ( OPTIONS ) [:=] names_spec = values_spec

names_spec: name1,name2,… values_spec: val1_1,val2_1,… val1_2,val2_2,… …

p_LINE(file: Path | str, line: str) Directive | None#

COMMAND ( OPTIONS ) [:=] ARGS

p_VVT(arg: Path | str) Generator[Directive, None, None]#

# VVT: COMMAND ( OPTIONS ) [:=] ARGS

combine_when_exprs(when1: dict[str, str], when2: dict[str, str]) dict[str, str]#
make_when_expr(options: dict) dict[str, str]#
find_vvt_lines(arg: Path | str) tuple[list[str], int]#

Find all lines starting with #VVT: COMMAND, or continuations #VVT::

p_OPTION(filename: str, tokens: list[TokenInfo]) tuple[str, Any]#

OPTION : NAME [true] | NAME EQUAL VALUE

p_OPTIONS(filename: str, tokens: list[TokenInfo]) list[tuple[str, Any]]#

OPTIONS : OPTION COMMA OPTION …

p_FILTER_WARNINGS(arg: Directive) bool#
importable(module_name: str) bool#
safe_eval(expression: str) Any#
evaluate_boolean_expression(expression: str) bool | None#
p_SKIPIF(arg: Directive) tuple[bool, str]#
unique(sequence: list[str]) list[str]#
to_seconds(arg: str | int | float, round: bool = False, negatives: bool = False) int | float#
exception ParseError#

Bases: Exception

exception VVTParseError(err, arg)#

Bases: Exception

exception InvalidTimeFormat(fmt)#

Bases: Exception