Debian Codegraph @

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

raw
1 set test "switch_file"
2 if {![installtest_p]} { untested $test; return }
3
4 # clean existing files
5 catch {exec rm -f $test.out*}
6
7 # run systemtap
8 set stpfile "$srcdir/$subdir/$test.stp"
9 verbose -log "Running stap -vo $test.out $stpfile"
10 catch {exec stap -vo $test.out $stpfile } res
11 verbose -log "$res"
12
13 # check output file
14 if {[catch {exec rm $test.out}]} {
15 fail "$test (no output file)"
16 return -1
17 } else {
18 pass "$test (output file)"
19 }
20
21 # check switched output file
22 if {[catch {exec rm $test.out.1}]} {
23 fail "$test (failed to switch output file)"
24 return -1
25 } else {
26 pass "$test (switch output file)"
27 }