mirror of
https://github.com/varun-r-mallya/Python-BPF.git
synced 2026-12-06 01:48:35 +00:00
tests: Add loop and AnnAssign xfail tests
- process_stmt now raises NotImplementedError on an unsupported statement instead of warning: a dropped statement silently changes what the program means (a for/while loop compiled to nothing). - failing_tests/loops/: 8 xfail tests for for/while/break/continue/nested loops and map iteration - failing_tests/assign/annotated_assign.py: xfail for `x: c_int64 = 0` (ast.AnnAssign is not handled)
This commit is contained in:
@ -401,11 +401,11 @@ def process_stmt(
|
||||
builder, stmt, local_sym_tab, ret_type, compilation_context
|
||||
)
|
||||
else:
|
||||
# Silently dropping a statement makes the program mean something other
|
||||
# than what it says, so say so.
|
||||
logger.warning(
|
||||
f"Unsupported statement on line {getattr(stmt, 'lineno', '?')}, "
|
||||
f"ignored: {type(stmt).__name__}"
|
||||
# Dropping a statement makes the program mean something other than what
|
||||
# it says (a loop compiles to nothing), so refuse rather than warn.
|
||||
raise NotImplementedError(
|
||||
f"Unsupported statement on line {getattr(stmt, 'lineno', '?')}: "
|
||||
f"{type(stmt).__name__}"
|
||||
)
|
||||
return did_return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user