|
26 | 26 | import subprocess |
27 | 27 | import typing |
28 | 28 | import itertools |
| 29 | +import os |
29 | 30 |
|
30 | 31 | import inflection |
31 | 32 |
|
@@ -287,7 +288,7 @@ def _is_under_qltest_collapsed_hierarchy(cls: schema.Class, lookup: typing.Dict[ |
287 | 288 | _is_in_qltest_collapsed_hierarchy(lookup[b], lookup) for b in cls.bases) |
288 | 289 |
|
289 | 290 |
|
290 | | -def _should_skip_qltest(cls: schema.Class, lookup: typing.Dict[str, schema.Class]): |
| 291 | +def should_skip_qltest(cls: schema.Class, lookup: typing.Dict[str, schema.Class]): |
291 | 292 | return "qltest_skip" in cls.pragmas or not ( |
292 | 293 | cls.final or "qltest_collapse_hierarchy" in cls.pragmas) or _is_under_qltest_collapsed_hierarchy( |
293 | 294 | cls, lookup) |
@@ -370,8 +371,10 @@ def generate(opts, renderer): |
370 | 371 |
|
371 | 372 | imports = {} |
372 | 373 | generated_import_prefix = get_import(out, opts.root_dir) |
| 374 | + registry = opts.generated_registry or pathlib.Path( |
| 375 | + os.path.commonpath((out, stub_out, test_out)), ".generated.list") |
373 | 376 |
|
374 | | - with renderer.manage(generated=generated, stubs=stubs, registry=opts.generated_registry, |
| 377 | + with renderer.manage(generated=generated, stubs=stubs, registry=registry, |
375 | 378 | force=opts.force) as renderer: |
376 | 379 |
|
377 | 380 | db_classes = [cls for name, cls in classes.items() if not data.classes[name].synth] |
@@ -413,7 +416,7 @@ def generate(opts, renderer): |
413 | 416 |
|
414 | 417 | if test_out: |
415 | 418 | for c in data.classes.values(): |
416 | | - if _should_skip_qltest(c, data.classes): |
| 419 | + if should_skip_qltest(c, data.classes): |
417 | 420 | continue |
418 | 421 | test_with = data.classes[c.test_with] if c.test_with else c |
419 | 422 | test_dir = test_out / test_with.group / test_with.name |
|
0 commit comments