File: num_args.tcl

package info (click to toggle)
systemtap 2.6-0.2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 21,220 kB
  • ctags: 10,944
  • sloc: cpp: 53,239; ansic: 50,615; exp: 33,694; sh: 9,906; xml: 7,665; perl: 2,089; python: 1,534; tcl: 1,236; makefile: 797; java: 148; lisp: 104; awk: 94; asm: 91; sed: 16
file content (64 lines) | stat: -rw-r--r-- 1,781 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
set tag "numeric"
eval spawn stap $srcdir/$subdir/num_args.stp
expect {
    -timeout 120
    "READY" {
	exec echo 1 > /proc/stap_test_cmd
	expect {
	    -timeout 5
	    "yyy_int -1 200 300\r\nyyy_int returns 499\r\n" {
		pass "integer function arguments -- $tag"
	    }
	    timeout {fail "integer function arguments -- $tag"}
	}
	exec echo 2 > /proc/stap_test_cmd
	expect {
	    -timeout 5
	    "yyy_uint 4294967295 200 300\r\nyyy_uint returns 499\r\n" {
		pass "unsigned function arguments -- $tag"
	    }
	    timeout {fail "unsigned function arguments -- $tag"}
	}
	exec echo 3 > /proc/stap_test_cmd
	expect {
	    -timeout 5
	    "yyy_long -1 200 300\r\nyyy_long returns 499\r\n" {
		pass "long function arguments -- $tag"
	    }
	    timeout {fail "long function arguments -- $tag"}
	}
	exec echo 4 > /proc/stap_test_cmd
	expect {
	    -timeout 5
	    "yyy_int64 -1 200 300\r\nyyy_int64 returns 499\r\n" {
		pass "int64 function arguments -- $tag"
	    }
	    timeout {fail "int64 function arguments -- $tag"}
	}
	exec echo 5 > /proc/stap_test_cmd
	expect {
	    -timeout 5
	    "yyy_char a b c\r\nyyy_char returns Q\r\n" {
		pass "char function arguments -- $tag"
	    }
	    timeout {fail "char function arguments -- $tag"}
	}
	exec echo 6 > /proc/stap_test_cmd
	expect {
	    -timeout 5
	    "yyy_str Hello-System-Tap\r\nyyy_str returns XYZZY\r\n" {
		pass "string function arguments -- $tag"
	    }
	    timeout {fail "string function arguments -- $tag"}
	    eof {fail "string function arguments -- $tag"}
	}
    }
    -re "semantic error:" {
	fail "function arguments -- $tag: compilation failed"
    }
    timeout {fail "all function arguments tests - timeout"}
    eof {fail "function arguments -- $tag: unexpected timeout"}
}
kill -INT -[exp_pid] 2
catch close
wait