2018-06-01 01:45:35 +02:00

49 lines
1.2 KiB
Python

from . import (
basic,
calc,
empty_return,
morespace,
strange_chars,
operators,
unary,
array_access,
parens,
assignments,
comments,
precedence,
call,
getfield,
branch,
switch,
for_loop,
for_empty,
for_in,
do_loop,
while_loop,
label,
func_expr,
object_literal,
try_statement,
with_statement,
debug,
unshift,
stringprototype
)
modules = [basic, calc, empty_return, morespace, strange_chars, operators, unary, array_access, parens, assignments,
comments, precedence, call, getfield, branch, switch, for_loop, for_empty, for_in, do_loop, while_loop,
label, func_expr, object_literal, try_statement, with_statement, debug, unshift, stringprototype]
def gettestcases():
for module in modules:
if hasattr(module, 'tests'):
case = {'name': module.__name__[len(__name__) + 1:], 'subtests': [], 'skip': {}}
for test in getattr(module, 'tests'):
if 'code' in test:
case['subtests'].append(test)
if hasattr(module, 'skip'):
case['skip'] = getattr(module, 'skip')
yield case