generator#

class VVTTestGenerator(root: str, path: str | None = None)#

Bases: PYTTestGenerator

file_patterns: ClassVar[tuple[str, ...]] = ('*.vvt',)#
load(file: str | None = None) None#
f_KEYWORDS(arg: SimpleNamespace) None#

# VVT : keywords [:=] word1 word2 … wordn

f_SOURCES(arg: SimpleNamespace) None#

#VVT : (link|copy|sources) ( OPTIONS ) [:=] file1 file2 .. | (link|copy|sources) (rename) [:=] file1,file2 file3,file4 …

f_PRELOAD(arg: SimpleNamespace) None#
f_PARAMETERIZE(arg: SimpleNamespace) None#
f_ANALYZE(arg: SimpleNamespace) None#

# VVT: analyze ( OPTIONS ) [:=] –FLAG | analyze ( OPTIONS ) [:=] FILE

f_TIMEOUT(arg: SimpleNamespace) None#

# VVT: timeout ( OPTIONS ) [:=] SECONDS

f_FILTER_WARNINGS(arg: SimpleNamespace) None#

# VVT: filter_warnings [:=] BOOL_EXPR

f_SKIPIF(arg: SimpleNamespace) None#

# VVT: skipif ( reason=STRING ) [:=] BOOL_EXPR

f_BASELINE(arg: SimpleNamespace) None#

# VVT: baseline ( OPTIONS ) [:=] –FLAG | baseline ( OPTIONS ) [:=] file1,file2 file3,file4 …

f_ENABLE(arg: SimpleNamespace) None#

# VVT: enable ( OPTIONS ) [:=] BOOL

f_NAME(arg: SimpleNamespace) None#

# VVT: name ( OPTIONS ) [:=] NAME

f_DEPENDS_ON(arg: SimpleNamespace) None#

# VVT: depends on ( OPTIONS ) [:=] STRING

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: SimpleNamespace) tuple[list, list, dict, list | None]#

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

p_PARAMETERIZE(arg: SimpleNamespace) 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) SimpleNamespace | None#

COMMAND ( OPTIONS ) [:=] ARGS

p_VVT(filename: Path | str) Generator[SimpleNamespace, 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(filename: 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: SimpleNamespace) bool#
importable(module_name: str) bool#
safe_eval(expression: str) Any#
evaluate_boolean_expression(expression: str) bool | None#
p_SKIPIF(arg: SimpleNamespace) 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