diff options
Diffstat (limited to 'testsuite/lib')
-rw-r--r-- | testsuite/lib/stap_run.exp | 14 | ||||
-rw-r--r-- | testsuite/lib/stap_run2.exp | 10 | ||||
-rw-r--r-- | testsuite/lib/stap_run_binary.exp | 10 |
3 files changed, 20 insertions, 14 deletions
diff --git a/testsuite/lib/stap_run.exp b/testsuite/lib/stap_run.exp index 68fceb32..baf41d9b 100644 --- a/testsuite/lib/stap_run.exp +++ b/testsuite/lib/stap_run.exp @@ -1,9 +1,3 @@ -# stap_run.exp -# -# Will Cohen -# 8/12/2005 - - # stap_run TEST_NAME LOAD_GEN_FUNCTION OUTPUT_CHECK_STRING # TEST_NAME is path to the current test # LOAD_GEN_FUNCTION (optional) to produce something to measure @@ -21,6 +15,10 @@ proc stap_run { TEST_NAME {LOAD_GEN_FUNCTION ""} {OUTPUT_CHECK_STRING ""} args } global probe_errors global skipped_probes + # zap the srcdir prefix + set test_file_name $TEST_NAME + set TEST_NAME [regsub {.*/testsuite/} $TEST_NAME ""] + # initialize probe_errors and skipped_probes to 0 set probe_errors 0 set skipped_probes 0 @@ -28,8 +26,8 @@ proc stap_run { TEST_NAME {LOAD_GEN_FUNCTION ""} {OUTPUT_CHECK_STRING ""} args } if {[info procs installtest_p] != "" && ![installtest_p]} { untested $TEST_NAME; return } set cmd [concat {stap -v} $args] - if [file readable $TEST_NAME] { - lappend cmd $TEST_NAME + if [file readable $test_file_name] { + lappend cmd $test_file_name } eval spawn $cmd expect { diff --git a/testsuite/lib/stap_run2.exp b/testsuite/lib/stap_run2.exp index d65e3874..290f0d84 100644 --- a/testsuite/lib/stap_run2.exp +++ b/testsuite/lib/stap_run2.exp @@ -11,6 +11,10 @@ set timeout 20 proc stap_run2 { TEST_NAME args } { + # zap the srcdir prefix + set test_file_name $TEST_NAME + set TEST_NAME [regsub {.*/testsuite/} $TEST_NAME ""] + if {[info procs installtest_p] != "" && ![installtest_p]} { untested $TEST_NAME; return } # fix up expected string @@ -18,8 +22,8 @@ proc stap_run2 { TEST_NAME args } { # spawn test set cmd [concat {stap -v} $args] - if [file readable $TEST_NAME] { - lappend cmd $TEST_NAME + if [file readable $test_file_name] { + lappend cmd $test_file_name } eval spawn $cmd @@ -30,7 +34,7 @@ proc stap_run2 { TEST_NAME args } { {set pass$expect_out(1,string) "\t0\t0\t0"; exp_continue} -re {^Pass 5: starting run.\r\n} {exp_continue} -ex $output { - pass "$TEST_NAME passed" + pass "$TEST_NAME" expect { -re {^Pass\ ([5]):[^\r]*\ in\ ([0-9]+)usr/([0-9]+)sys/([0-9]+)real\ ms.\r\n} {set pass$expect_out(1,string) "\t$expect_out(2,string)\t$expect_out(3,string)\t$expect_out(4,string)" diff --git a/testsuite/lib/stap_run_binary.exp b/testsuite/lib/stap_run_binary.exp index f29e8f35..1d31d817 100644 --- a/testsuite/lib/stap_run_binary.exp +++ b/testsuite/lib/stap_run_binary.exp @@ -6,15 +6,19 @@ # global result_string must be set to the expected output proc stap_run_binary { TEST_NAME} { + # zap the srcdir prefix + set test_file_name $TEST_NAME + set TEST_NAME [regsub {.*/testsuite/} $TEST_NAME ""] + if {[info procs installtest_p] != "" && ![installtest_p]} {untested $TEST_NAME; return} set hex_args {-ve 8/1 "%02x " "\n"} - set res [exec stap $TEST_NAME | hexdump $hex_args] + set res [exec stap $test_file_name | hexdump $hex_args] if {[string compare $res $::result_string] == 0} { - pass "$TEST_NAME passed" + pass "$TEST_NAME" } else { - fail "$TEST_NAME failed" + fail "$TEST_NAME" puts "EXPECTED:\n-----------------------\n<$::result_string>" puts "-----------------------\n" puts "GOT:\n-----------------------\n<$res>" |