Swift: add unit tests to code generation

Tests can be run with
```
bazel test //swift/codegen:tests
```

Coverage can be checked installing `pytest-cov` and running
```
pytest --cov=swift/codegen swift/codegen/test
```
This commit is contained in:
Paolo Tranquilli
2022-04-26 18:22:40 +02:00
parent 2d05ea3519
commit f171ce6341
19 changed files with 1008 additions and 149 deletions

View File

@@ -15,6 +15,16 @@ answer_to_life_the_universe_and_everything(
// from codegen/schema.yml
@element =
@argument
| @file
| @generic_context
| @iterable_decl_context
| @locatable
| @location
| @type
;
files(
unique int id: @file,
string name: string ref
@@ -1886,13 +1896,3 @@ integer_literal_exprs(
unique int id: @integer_literal_expr,
string string_value: string ref
);
@element =
@argument
| @file
| @generic_context
| @iterable_decl_context
| @locatable
| @location
| @type
;