File tree Expand file tree Collapse file tree 3 files changed +55
-0
lines changed
lldb/lldb/test/API/iohandler/sigint Expand file tree Collapse file tree 3 files changed +55
-0
lines changed Original file line number Diff line number Diff line change
1
+ include Makefile.rules
Original file line number Diff line number Diff line change
1
+ """
2
+ Test sending SIGINT Process IOHandler
3
+ """
4
+
5
+ import os
6
+
7
+ import lldb
8
+ from lldbsuite .test .decorators import *
9
+ from lldbsuite .test .lldbtest import *
10
+ from lldbsuite .test .lldbpexpect import PExpectTest
11
+
12
+ class TestCase (PExpectTest ):
13
+
14
+ mydir = TestBase .compute_mydir (__file__ )
15
+
16
+ def test (self ):
17
+ self .build (dictionary = {"CXX_SOURCES" :"cat.cpp" })
18
+ self .launch (executable = self .getBuildArtifact (), timeout = 5 )
19
+
20
+ self .child .sendline ("process launch" )
21
+ self .child .expect ("Process .* launched" )
22
+
23
+ self .child .sendline ("Hello cat" )
24
+ self .child .expect_exact ("read: Hello cat" )
25
+
26
+ self .child .sendintr ()
27
+ self .child .expect ("Process .* stopped" )
28
+ self .expect_prompt ()
29
+
30
+ self .expect ("bt" , substrs = ["input_copy_loop" ])
31
+
32
+ self .child .sendline ("continue" )
33
+ self .child .expect ("Process .* resuming" )
34
+
35
+ self .child .sendline ("Goodbye cat" )
36
+ self .child .expect_exact ("read: Goodbye cat" )
37
+
38
+ self .child .sendeof ()
39
+ self .child .expect ("Process .* exited" )
40
+ self .expect_prompt ()
41
+
42
+ self .quit ()
Original file line number Diff line number Diff line change
1
+ #include < iostream>
2
+
3
+ void input_copy_loop () {
4
+ std::string str;
5
+ while (std::getline (std::cin, str))
6
+ std::cout << " read: " << str << std::endl;
7
+ }
8
+
9
+ int main () {
10
+ input_copy_loop ();
11
+ return 0 ;
12
+ }
You can’t perform that action at this time.
0 commit comments