Commit 9c89d20
feat(tests): add compile_with_modules helper to Tester (#420)
## Summary
- Add `add_module()` and `compile_with_modules()` to the `Tester` test
framework
- Supports both separate `add_module()` calls and single-string
`#[filename]` syntax via `add_files()`
- Automatically scans module dependencies with `scan_precise`,
topologically sorts, builds PCMs in order, then compiles the main file
- Temporary PCM files cleaned up automatically in destructor
- Migrated `ModuleImport` and `ModuleReexport` semantic tokens tests to
use the new API
## Test plan
- [x] All 505 unit tests pass
- [x] All 113 integration tests pass
- [x] All 2 smoke tests pass
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Tests**
* Centralized, module-aware test compilation with automatic module
discovery, dependency ordering, and cycle detection.
* Unified "compile with modules" flow; tests now add module sources
directly and no longer manage temporary module artifacts manually.
* Reduced duplicated compile/diagnostic logic and improved cleanup of
generated artifacts.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 8bafaa8 commit 9c89d20
File tree
3 files changed
+197
-143
lines changed- tests/unit
- feature
- test
3 files changed
+197
-143
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
449 | 449 | | |
450 | 450 | | |
451 | 451 | | |
452 | | - | |
453 | | - | |
454 | | - | |
455 | | - | |
456 | | - | |
457 | | - | |
458 | | - | |
459 | | - | |
460 | | - | |
461 | | - | |
462 | | - | |
463 | | - | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
464 | 456 | | |
465 | | - | |
| 457 | + | |
466 | 458 | | |
467 | 459 | | |
468 | | - | |
469 | | - | |
470 | | - | |
471 | | - | |
472 | | - | |
473 | | - | |
474 | | - | |
475 | | - | |
476 | | - | |
477 | | - | |
478 | | - | |
479 | | - | |
480 | | - | |
| 460 | + | |
| 461 | + | |
481 | 462 | | |
482 | 463 | | |
483 | 464 | | |
484 | 465 | | |
485 | 466 | | |
486 | | - | |
487 | | - | |
488 | 467 | | |
489 | 468 | | |
490 | 469 | | |
| |||
500 | 479 | | |
501 | 480 | | |
502 | 481 | | |
503 | | - | |
504 | | - | |
505 | | - | |
506 | | - | |
507 | | - | |
508 | | - | |
509 | | - | |
510 | | - | |
511 | | - | |
512 | | - | |
513 | | - | |
514 | | - | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
515 | 486 | | |
516 | | - | |
| 487 | + | |
517 | 488 | | |
518 | 489 | | |
519 | | - | |
520 | | - | |
521 | | - | |
522 | | - | |
523 | | - | |
524 | | - | |
525 | | - | |
526 | | - | |
527 | | - | |
528 | | - | |
529 | | - | |
530 | | - | |
531 | | - | |
532 | | - | |
| 490 | + | |
| 491 | + | |
533 | 492 | | |
534 | 493 | | |
535 | 494 | | |
536 | 495 | | |
537 | 496 | | |
538 | | - | |
539 | | - | |
540 | 497 | | |
541 | 498 | | |
542 | 499 | | |
| |||
0 commit comments