Introduce the lkt_build_and_run test driver

Transition all relevant testcases to it. In the process, port
docstrings/comments from test.py files to expected_concrete_syntax.lkt
(now test.lkt) sources and fix stylechecks issues there.

(cherry picked from commit e1c4fe5804)
This commit is contained in:
Pierre-Marie de Rodat
2024-10-14 09:47:37 +00:00
parent 90ed33f542
commit ca751250b4
805 changed files with 3004 additions and 14422 deletions

View File

@@ -1,3 +1,6 @@
# Check that the Python bindings to wrap/unwrap arrays of structs of arrays work
# as expected.
import lexer_example
@with_lexer(foo_lexer)

View File

@@ -1,35 +0,0 @@
"""
Check that the Python bindings to wrap/unwrap arrays of structs of arrays work
as expected.
"""
from langkit.dsl import ASTNode, Struct, T, UserField
from langkit.expressions import Entity, langkit_property
from utils import build_and_run
class FooNode(ASTNode):
pass
class ExampleHolder(Struct):
examples = UserField(type=T.Example.entity.array)
class Example(FooNode):
@langkit_property(return_type=ExampleHolder.array, public=True)
def example_holders():
return ExampleHolder.new(examples=Entity.singleton).singleton
@langkit_property(return_type=ExampleHolder.array, public=True)
def identity(a=ExampleHolder.array):
return a
build_and_run(
lkt_file='expected_concrete_syntax.lkt',
py_script='main.py',
types_from_lkt=True,
)
print('Done')

View File

@@ -1 +1,2 @@
driver: python
driver: lkt_build_and_run
py_script: main.py