Debian Codegraph @

testsuite/systemtap.context/num_args.tcl

raw
1 set tag "numeric"
2 eval spawn stap $srcdir/$subdir/num_args.stp
3 expect {
4 -timeout 120
5 "READY" {
6 sleep 1
7 exec echo 1 > /proc/stap_test_cmd
8 expect {
9 -timeout 5
10 "yyy_int -1 200 300\r\nyyy_int returns 499\r\n" {
11 pass "integer function arguments -- $tag"
12 }
13 timeout {fail "integer function arguments -- $tag"}
14 }
15 exec echo 2 > /proc/stap_test_cmd
16 expect {
17 -timeout 5
18 "yyy_uint 4294967295 200 300\r\nyyy_uint returns 499\r\n" {
19 pass "unsigned function arguments -- $tag"
20 }
21 timeout {fail "unsigned function arguments -- $tag"}
22 }
23 exec echo 3 > /proc/stap_test_cmd
24 expect {
25 -timeout 5
26 "yyy_long -1 200 300\r\nyyy_long returns 499\r\n" {
27 pass "long function arguments -- $tag"
28 }
29 timeout {fail "long function arguments -- $tag"}
30 }
31 exec echo 4 > /proc/stap_test_cmd
32 expect {
33 -timeout 5
34 "yyy_int64 -1 200 300\r\nyyy_int64 returns 499\r\n" {
35 pass "int64 function arguments -- $tag"
36 }
37 timeout {fail "int64 function arguments -- $tag"}
38 }
39 exec echo 5 > /proc/stap_test_cmd
40 expect {
41 -timeout 5
42 "yyy_char a b c\r\nyyy_char returns Q\r\n" {
43 pass "char function arguments -- $tag"
44 }
45 timeout {fail "char function arguments -- $tag"}
46 }
47 exec echo 6 > /proc/stap_test_cmd
48 expect {
49 -timeout 5
50 "yyy_str Hello-System-Tap\r\nyyy_str returns XYZZY\r\n" {
51 pass "string function arguments -- $tag"
52 }
53 timeout {fail "string function arguments -- $tag"}
54 eof {fail "string function arguments -- $tag"}
55 }
56 }
57 -re "semantic error:" {
58 fail "function arguments -- $tag: compilation failed"
59 }
60 timeout {fail "all function arguments tests - timeout"}
61 eof {fail "function arguments -- $tag: unexpected timeout"}
62 }
63 kill -INT -[exp_pid] 2
64 catch { close }
65 catch { wait }