From d915113116e60fac668ccdc40e89e9d8eabf473f Mon Sep 17 00:00:00 2001 From: David Smith Date: Wed, 20 Jul 2011 16:32:30 -0500 Subject: [PATCH] Improved prcwildcard.exp and cmd_parse.exp tests. * testsuite/systemtap.base/prcwildcard.exp: If we're testing a stripped stap, don't bother running the function test, which needs debuginfo. * testsuite/systemtap.base/cmd_parse.exp: Increase timeout. * testsuite/lib/systemtap.exp (stripped_p): New function to determine if an executable is stripped. --- testsuite/lib/systemtap.exp | 7 +++++++ testsuite/systemtap.base/cmd_parse.exp | 2 +- testsuite/systemtap.base/prcwildcard.exp | 25 ++++++++++++++---------- 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/testsuite/lib/systemtap.exp b/testsuite/lib/systemtap.exp index e546c447d..a64563111 100644 --- a/testsuite/lib/systemtap.exp +++ b/testsuite/lib/systemtap.exp @@ -394,3 +394,10 @@ proc sdt_includes {} { return $flags } + +proc stripped_p { EXE } { + if { [catch {eval exec "file $EXE | grep -q \"not stripped\""} dummy] } { + return 1 + } + return 0 +} diff --git a/testsuite/systemtap.base/cmd_parse.exp b/testsuite/systemtap.base/cmd_parse.exp index f0c285e33..ec4ba74ce 100644 --- a/testsuite/systemtap.base/cmd_parse.exp +++ b/testsuite/systemtap.base/cmd_parse.exp @@ -70,7 +70,7 @@ wait;catch {close} spawn stap -l {vm.*} expect { - -timeout 60 + -timeout 180 -re "vm.*" {pass "cmd_parse8"} timeout {fail "cmd_parse8: unexpected timeout"} eof {fail "cmd_parse8: unexpected EOF"} diff --git a/testsuite/systemtap.base/prcwildcard.exp b/testsuite/systemtap.base/prcwildcard.exp index 5a94f7bef..bee0362e3 100644 --- a/testsuite/systemtap.base/prcwildcard.exp +++ b/testsuite/systemtap.base/prcwildcard.exp @@ -1,18 +1,23 @@ +set stap_path $env(SYSTEMTAP_PATH)/stap set test "prcwildcard function" -spawn stap -L {process("../sta*").function("*")} -set count 0 -expect { - -re {^process[^\r\n]+\r\n} { incr count; exp_continue } - timeout { } - eof { } +# Looking for functions in stap will only work if it isn't stripped. +if {[stripped_p $stap_path]} { + untested $test +} else { + spawn stap -L "process(\"$stap_path\").function(\"*\")" + set count 0 + expect { + -re {^process[^\r\n]+\r\n} { incr count; exp_continue } + timeout { } + eof { } + } + catch {close}; catch {wait} + if {$count > 100} then { pass $test } else { fail $test } } -catch {close}; catch {wait} -if {$count > 100} then { pass $test } else { fail $test } - set test "prcwildcard mark" -spawn stap -L {process("../sta*").mark("*")} +spawn stap -L "process(\"$stap_path\").mark(\"*\")" set count 0 expect { -re {^process[^\r\n]+\r\n} { incr count; exp_continue } -- 2.43.5