Commit d316010
committed
tests: Add Ctrl-C interrupt tests using extended repl_ framework.
Extends the repl_ test framework to support signal generation by
configuring terminal attributes (ISIG, VINTR) and setting up the PTY
as the controlling terminal for the MicroPython subprocess.
This allows testing Ctrl-C interrupt behavior in both paste mode and
during code execution using the standard repl_ test syntax with {\x03}
for Ctrl-C control codes.
Tests added:
- repl_ctrl_c_interrupt.py: Tests Ctrl-C cancels paste mode
- repl_ctrl_c_interrupt_execution.py: Tests Ctrl-C interrupts running code
Changes to run-tests.py:
- Added terminal configuration to enable ISIG flag and VINTR mapping
- Added setup_controlling_terminal() to make PTY the controlling terminal
- Modified repl_ Popen call to use preexec_fn for proper signal delivery
Signed-off-by: Andrew Leech <[email protected]>1 parent 27544a2 commit d316010
File tree
6 files changed
+105
-18
lines changed- tests
- cmdline
6 files changed
+105
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
63 | 80 | | |
64 | 81 | | |
65 | 82 | | |
| |||
602 | 619 | | |
603 | 620 | | |
604 | 621 | | |
| 622 | + | |
| 623 | + | |
605 | 624 | | |
606 | 625 | | |
607 | 626 | | |
| |||
632 | 651 | | |
633 | 652 | | |
634 | 653 | | |
635 | | - | |
636 | | - | |
637 | | - | |
638 | | - | |
639 | | - | |
640 | | - | |
641 | | - | |
642 | | - | |
643 | | - | |
644 | | - | |
645 | | - | |
646 | | - | |
647 | 654 | | |
648 | | - | |
649 | | - | |
650 | | - | |
651 | | - | |
652 | | - | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
653 | 692 | | |
654 | 693 | | |
655 | 694 | | |
| |||
705 | 744 | | |
706 | 745 | | |
707 | 746 | | |
708 | | - | |
| 747 | + | |
709 | 748 | | |
710 | 749 | | |
711 | 750 | | |
| |||
0 commit comments