From 814bc89d4635f101b2c0077598f31aad95ed15b7 Mon Sep 17 00:00:00 2001 From: fche Date: Sat, 12 Aug 2006 05:13:09 +0000 Subject: 2006-08-12 Frank Ch. Eigler * configure.ac, Makefile.am: Descend into testsuite/ directory. Remove local test logic. * configure, Makefile.in: Regenerated. * runtest.sh: Not yet removed. * HACKING: Update for new testsuite layout. 2006-08-12 Frank Ch. Eigler * all: Reorganized old pass-1..4 tests one dejagnu bucket. Moved over old pass-5 tests, except for disabled syscalls tests. * Makefile (installcheck): New target for running pass-1..5 tests against installed systemtap. --- testsuite/lib/stap_run2.exp | 51 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 testsuite/lib/stap_run2.exp (limited to 'testsuite/lib/stap_run2.exp') diff --git a/testsuite/lib/stap_run2.exp b/testsuite/lib/stap_run2.exp new file mode 100644 index 00000000..a182a2c5 --- /dev/null +++ b/testsuite/lib/stap_run2.exp @@ -0,0 +1,51 @@ +# stap_run2.exp +# +# Simple script for testing multiple lines of exact output. + + +# stap_run2 TEST_NAME +# TEST_NAME is path to the current test +# Additional arguments are passed to stap as-is. +# +# global result_string must be set to the expected output + +set timeout 20 + +proc stap_run2 { TEST_NAME args } { + if {![installtest_p]} { untested $TEST_NAME; return } + + # fix up expected string + regsub -all \n $::result_string \r\n output + + # spawn test + set cmd [concat {stap -v} $args] + if [file readable $TEST_NAME] { + lappend cmd $TEST_NAME + } + eval spawn $cmd + + expect { + -re {^Pass\ ([1234]):[^\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)"; exp_continue} + -re {^Pass 5: starting run.\r\n} {exp_continue} + -ex $output { + pass "$TEST_NAME passed" + 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)" + verbose -log "metric:\t$TEST_NAME $pass1$pass2$pass3$pass4$pass5"} + } + } + timeout { + fail "$TEST_NAME timed out" } + eof { + fail "$TEST_NAME unexpected EOF" } + -re "semantic error:" { fail "$TEST_NAME compilation" } + -re "ERROR:" { + send "\003" + fail "$TEST_NAME runtime error" + } + } + catch close + wait +} -- cgit