Commit 66c748c
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
This approach reuses existing infrastructure rather than creating a
separate test framework, keeping the codebase simpler while enabling
signal generation testing.
Signed-off-by: Andrew Leech <[email protected]>1 parent a2b2e9d commit 66c748c
File tree
6 files changed
+114
-14
lines changed- tests
- cmdline
6 files changed
+114
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
| |||
| 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 | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
619 | 619 | | |
620 | 620 | | |
621 | 621 | | |
| 622 | + | |
| 623 | + | |
622 | 624 | | |
623 | 625 | | |
624 | 626 | | |
| |||
629 | 631 | | |
630 | 632 | | |
631 | 633 | | |
632 | | - | |
633 | | - | |
634 | | - | |
635 | | - | |
636 | | - | |
637 | | - | |
638 | | - | |
639 | | - | |
| 634 | + | |
| 635 | + | |
640 | 636 | | |
641 | 637 | | |
642 | 638 | | |
| |||
649 | 645 | | |
650 | 646 | | |
651 | 647 | | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
652 | 662 | | |
653 | | - | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
654 | 669 | | |
655 | 670 | | |
656 | 671 | | |
| |||
808 | 823 | | |
809 | 824 | | |
810 | 825 | | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
811 | 862 | | |
812 | 863 | | |
813 | 864 | | |
| |||
1098 | 1149 | | |
1099 | 1150 | | |
1100 | 1151 | | |
1101 | | - | |
| 1152 | + | |
| 1153 | + | |
1102 | 1154 | | |
1103 | 1155 | | |
1104 | 1156 | | |
| |||
1113 | 1165 | | |
1114 | 1166 | | |
1115 | 1167 | | |
1116 | | - | |
| 1168 | + | |
| 1169 | + | |
1117 | 1170 | | |
1118 | 1171 | | |
1119 | 1172 | | |
1120 | | - | |
| 1173 | + | |
| 1174 | + | |
1121 | 1175 | | |
1122 | 1176 | | |
1123 | 1177 | | |
| |||
1204 | 1258 | | |
1205 | 1259 | | |
1206 | 1260 | | |
1207 | | - | |
| 1261 | + | |
| 1262 | + | |
1208 | 1263 | | |
1209 | 1264 | | |
1210 | 1265 | | |
1211 | 1266 | | |
1212 | | - | |
| 1267 | + | |
| 1268 | + | |
1213 | 1269 | | |
1214 | 1270 | | |
1215 | 1271 | | |
| |||
0 commit comments