From 7c5a10b487895714c2307a9532f6866d77001c15 Mon Sep 17 00:00:00 2001 From: Chris Meek Date: Thu, 15 Dec 2011 14:03:47 -0500 Subject: [PATCH] PR13274: Fixed testsuite for standard warning processing (without elaborate.cxx) Since we are now using "WARNING" rather than "Warning", some of the expect statements in some test cases needed to be tweaked. --- testsuite/systemtap.base/beginenderror.exp | 2 +- testsuite/systemtap.base/trycatch.exp | 4 ++-- testsuite/systemtap.context/uprobe_stmt_num.c | 4 +++- testsuite/systemtap.context/uprobe_stmt_num.exp | 6 +++--- testsuite/systemtap.stress/conversions.exp | 2 +- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/testsuite/systemtap.base/beginenderror.exp b/testsuite/systemtap.base/beginenderror.exp index 1ab50fdba..534f0fc6b 100644 --- a/testsuite/systemtap.base/beginenderror.exp +++ b/testsuite/systemtap.base/beginenderror.exp @@ -16,7 +16,7 @@ expect { eof { } } wait -if {$ok1 == 4 && $ok2 == 3 && $ko == 0} then { +if {$ok1 == 5 && $ok2 == 3 && $ko == 0} then { pass "$test ($ok1 $ok2 $ko)" } else { fail "$test ($ok1 $ok2 $ko)" diff --git a/testsuite/systemtap.base/trycatch.exp b/testsuite/systemtap.base/trycatch.exp index ad6501470..228e8fd86 100644 --- a/testsuite/systemtap.base/trycatch.exp +++ b/testsuite/systemtap.base/trycatch.exp @@ -9,7 +9,7 @@ expect { -timeout 30 -re {^ERROR: MAXACTION[^\r\n]*\r\n} { incr ok; exp_continue } -re {^WARNING: Number of errors[^\r\n]*\r\n} { incr ok; exp_continue } - -re {^Warning:[^\r\n]* exited with status:[^\r\n]*\r\n} {incr ok; exp_continue } + -re {^WARNING:[^\r\n]* exited with status:[^\r\n]*\r\n} {incr ok; exp_continue } -re {^Pass 5: run failed[^\r\n]*\r\n} { incr ok; exp_continue } -re {^OK[^\r\n]*\r\n} { incr ok; exp_continue } -re {^KO[^\r\n]*\r\n} { incr ko; exp_continue } @@ -29,7 +29,7 @@ expect { -timeout 30 -re {^ERROR: MAXACTION[^\r\n]*\r\n} { incr ok; exp_continue } -re {^WARNING: Number of errors[^\r\n]*\r\n} { incr ok; exp_continue } - -re {^Warning:[^\r\n]* exited with status:[^\r\n]*\r\n} {incr ok; exp_continue } + -re {^WARNING:[^\r\n]* exited with status:[^\r\n]*\r\n} {incr ok; exp_continue } -re {^Pass 5: run failed[^\r\n]*\r\n} { incr ok; exp_continue } -re {^OK[^\r\n]*\r\n} { incr ok; exp_continue } -re {^KO[^\r\n]*\r\n} { incr ko; exp_continue } diff --git a/testsuite/systemtap.context/uprobe_stmt_num.c b/testsuite/systemtap.context/uprobe_stmt_num.c index 887e572a3..320ae48dd 100644 --- a/testsuite/systemtap.context/uprobe_stmt_num.c +++ b/testsuite/systemtap.context/uprobe_stmt_num.c @@ -16,5 +16,7 @@ func (int arg) int main (int argc, char *argv[], char *envp[]) { - return func(42); +// Note: Passing to srand to force evaluation of func(). + srand(func(42)); + return 0; } diff --git a/testsuite/systemtap.context/uprobe_stmt_num.exp b/testsuite/systemtap.context/uprobe_stmt_num.exp index 2210ff97c..d134fd723 100644 --- a/testsuite/systemtap.context/uprobe_stmt_num.exp +++ b/testsuite/systemtap.context/uprobe_stmt_num.exp @@ -21,7 +21,7 @@ if { $res != "" } { return } -set cmd [concat stap -c $testexe $teststp] +set cmd [concat stap -wc $testexe $teststp] send_log "cmd: $cmd\n" catch {eval exec $cmd} output send_log "cmd output: $output\n" @@ -47,7 +47,7 @@ if { $lines >= 6 } { set ::result_string $output # Sanity check, just run again... -stap_run3 $test-run-two $testpath/$test.stp -c $testexe +stap_run3 $test-run-two -w $testpath/$test.stp -c $testexe # create a script based on the given statements, # probe all of them individually. @@ -59,7 +59,7 @@ foreach line $output_lines { puts $fp "}" } close $fp -stap_run3 $test-run-statements $test-run-statements.stp -c $testexe +stap_run3 $test-run-statements -w $test-run-statements.stp -c $testexe # Now strip away the line info and try again (with -g). set strip_cmd [list "objcopy" "-R" ".debug_line"] diff --git a/testsuite/systemtap.stress/conversions.exp b/testsuite/systemtap.stress/conversions.exp index 7e011440c..06114039a 100644 --- a/testsuite/systemtap.stress/conversions.exp +++ b/testsuite/systemtap.stress/conversions.exp @@ -19,6 +19,6 @@ foreach value {0 0xffffffff 0xffffffffffffffff} { } verbose -log "done exp $test $errs" wait - if {$errs == 17} { pass $test } else { fail "$test ($errs)" } + if {$errs == 18} { pass $test } else { fail "$test ($errs)" } verbose -log "done $test $errs" } -- 2.43.5