Debian Codegraph @

doc/SystemTap_Beginners_Guide/testsuite/systemtap.base/stmt_counting.exp

raw
1 set test_names {"stmt_counting_recursion" "stmt_counting_loops" "stmt_counting_straight" "stmt_counting_functions"}
2
3 foreach test_name $test_names {
4 set test_val 6
5 # Expected output
6 set output_string "pass\r\n"
7 if {! [installtest_p]} {
8 untested $test_name
9 return
10 }
11 verbose -log "running test $test_name"
12
13 set stap_flags {"" "-u" "-DMAXACTION=40" "-DMAXACTION=1"}
14 foreach stap_flag $stap_flags {
15 verbose -log "running test $test_name with flag: $stap_flag"
16
17 foreach runtime [get_runtime_list] {
18 if {$runtime != ""} {
19 verbose -log "runtime flag is $runtime"
20 set cur_test_name "$test_name ($runtime)"
21
22 if {$stap_flag == "-DMAXACTION=1"} {
23 spawn stap --runtime=$runtime $stap_flag $srcdir/$subdir/$test_name.stp $test_val
24 expect {
25 -re {ERROR.*MAXACTION} { pass $test_name }
26 }
27 catch { close }; catch { wait }
28 } elseif {$stap_flag == ""} {
29 stap_run $cur_test_name no_load $output_string --runtime=$runtime $srcdir/$subdir/$test_name.stp $test_val
30 } else {
31 stap_run $cur_test_name no_load $output_string --runtime=$runtime $stap_flag $srcdir/$subdir/$test_name.stp $test_val
32 }
33
34 } elseif {[uprobes_p]} {
35 if {$stap_flag == "-DMAXACTION=1"} {
36 spawn stap $stap_flag $srcdir/$subdir/$test_name.stp $test_val
37 expect {
38 -re {ERROR.*MAXACTION} { pass $test_name }
39 }
40 catch { close }; catch { wait }
41 } elseif {$stap_flag == ""} {
42 stap_run $test_name no_load $output_string $srcdir/$subdir/$test_name.stp $test_val
43
44 } else {
45 stap_run $test_name no_load $output_string $stap_flag $srcdir/$subdir/$test_name.stp $test_val
46 }
47
48 } else {
49 untested "$test_name (uprobes)"
50 continue
51 }
52 }
53 }
54 }