diff options
author | Frank Ch. Eigler <fche@elastic.org> | 2008-07-09 22:44:13 -0400 |
---|---|---|
committer | Frank Ch. Eigler <fche@elastic.org> | 2008-07-09 22:44:13 -0400 |
commit | a00cc8c70d20f2f3429590b629d272c8db65b40f (patch) | |
tree | 6a90966d1a715c48db4ac35b891c46ef654f272f /testsuite | |
parent | df00639dbe262b8919bdf625f30d80e5b9b96346 (diff) | |
parent | 51a3785482396c9f653e3e7647945bfc24f7b160 (diff) | |
download | systemtap-steved-a00cc8c70d20f2f3429590b629d272c8db65b40f.tar.gz systemtap-steved-a00cc8c70d20f2f3429590b629d272c8db65b40f.tar.xz systemtap-steved-a00cc8c70d20f2f3429590b629d272c8db65b40f.zip |
Merge commit 'origin/master' into pr6429-comp-unwindsyms
* commit 'origin/master':
fix shutdown race condition for scripts that might exit during begin probes
Fix PR 6732: Add runtime/autoconf-real-parent.c check for task_struct field.
clarify dejagnu test case name for empty-struct changes
add changelog entries for last two changes
Add test suite for declaration resolution
Fix semantic error: empty struct
Add hack to support git 1.6 in git_version.sh
Sync latest fix for git_version.sh from RadeonHD's tree
Slightly cleanup code of translate.cxx
PR2111: add general blurbage to stapprobes.5 on syscalls tapset
Use `uname -rvm` for checking system compatibility. Generate
Add section to stapex manual page on how installed examples are documented.
Install examples, demos and samples.
Install tutorial and langref manuals.
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | testsuite/config/unix.exp | 1 | ||||
-rw-r--r-- | testsuite/lib/stap_compile.exp | 39 | ||||
-rw-r--r-- | testsuite/systemtap.base/declaration.exp | 19 | ||||
-rw-r--r-- | testsuite/systemtap.base/marker.exp | 40 |
5 files changed, 65 insertions, 40 deletions
diff --git a/testsuite/ChangeLog b/testsuite/ChangeLog index 9353cc32..7296f52c 100644 --- a/testsuite/ChangeLog +++ b/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2008-07-09 Frank Ch. Eigler <fche@elastic.org> + + From <James.Bottomley@HansenPartnership.com>: + * systemtap.base/declaration.exp: New test. + * lib/stap_compile.exp: New file, stap_compile moved from ... + * systemtap.base/marker.exp: ... here. 2008-07-01 Wenji Huang <wenji.huang@oracle.com> diff --git a/testsuite/config/unix.exp b/testsuite/config/unix.exp index 625c5604..52560cac 100644 --- a/testsuite/config/unix.exp +++ b/testsuite/config/unix.exp @@ -3,3 +3,4 @@ load_lib "stap_run2.exp" load_lib "stap_run_exact.exp" load_lib "stap_run_binary.exp" load_lib "stap_run.exp" +load_lib "stap_compile.exp" diff --git a/testsuite/lib/stap_compile.exp b/testsuite/lib/stap_compile.exp new file mode 100644 index 00000000..8c6df0ee --- /dev/null +++ b/testsuite/lib/stap_compile.exp @@ -0,0 +1,39 @@ +# stap_compile TEST_NAME flags script args +# - TEST_NAME is the name of the current test +# - compile indicates whether the script is supposed to compile +# - script is the script to compile +# Additional arguments are passed to stap as-is. +proc stap_compile { TEST_NAME compile script args } { + set cmd [concat {stap -v -p4 -e} $script $args] + + verbose -log "running $cmd" + eval spawn $cmd + set compile_errors 0 + expect { + -re {^Pass\ [1234]:[^\r]*\ in\ .*\ ms.\r\n} {exp_continue} + -re {^Pass\ [34]: using cached [^\r\n]+\r\n} {exp_continue} + # pass-4 output + -re {^/[^\r\n]+.ko\r\n} {exp_continue} + -re "parse error" { incr compile_errors 1; exp_continue} + -re "compilation failed" {incr compile_errors 1; exp_continue} + -re "semantic error:" {incr compile_errors 1; exp_continue} + } + catch close + wait + + # If we've got compile errors and the script was supposed to + # compile, fail. + if {$compile_errors > 0} { + if {$compile == 1} { + fail "$TEST_NAME compilation failed" + } else { + pass "$TEST_NAME compilation failed correctly" + } + } else { + if {$compile == 1} { + pass "$TEST_NAME compilation succeeded" + } else { + fail "$TEST_NAME compilation succeeded unexpectedly" + } + } +} diff --git a/testsuite/systemtap.base/declaration.exp b/testsuite/systemtap.base/declaration.exp new file mode 100644 index 00000000..e47898a7 --- /dev/null +++ b/testsuite/systemtap.base/declaration.exp @@ -0,0 +1,19 @@ +# Declaration tests. Specifically looking for resolution of +# DW_AT_declaration from another module + +set TEST_NAME "empty-struct resolve-fail" + +# this test just makes sure $device is still stubbed with DW_AT_declaration +set failscript { + probe\ module(\"libata\").function(\"ata_qc_issue\")\ \{\ print(\$qc->\$scsicmd->\$device->\$host->\$host_no)\ \}; +} + +stap_compile $TEST_NAME 0 $failscript + +set TEST_NAME "empty-struct resolve-pass" + +set passscript { + probe\ module(\"scsi_mod\").function(\"scsi_request_fn\")\ \{print(\$q)\} +} + +stap_compile $TEST_NAME 1 [concat $passscript $failscript ] diff --git a/testsuite/systemtap.base/marker.exp b/testsuite/systemtap.base/marker.exp index 857fa5d2..89c0b8c3 100644 --- a/testsuite/systemtap.base/marker.exp +++ b/testsuite/systemtap.base/marker.exp @@ -3,46 +3,6 @@ # trigger a specific marker). So, we'll try to compile lots of tests # to do as much as we can. -# stap_compile TEST_NAME flags script args -# - TEST_NAME is the name of the current test -# - compile indicates whether the script is supposed to compile -# - script is the script to compile -# Additional arguments are passed to stap as-is. -proc stap_compile { TEST_NAME compile script args } { - set cmd [concat {stap -v -p4 -e} $script $args] - - verbose -log "running $cmd" - eval spawn $cmd - set compile_errors 0 - expect { - -re {^Pass\ [1234]:[^\r]*\ in\ .*\ ms.\r\n} {exp_continue} - -re {^Pass\ [34]: using cached [^\r\n]+\r\n} {exp_continue} - # pass-4 output - -re {^/[^\r\n]+.ko\r\n} {exp_continue} - -re "parse error" { incr compile_errors 1; exp_continue} - -re "compilation failed" {incr compile_errors 1; exp_continue} - -re "semantic error:" {incr compile_errors 1; exp_continue} - } - catch close - wait - - # If we've got compile errors and the script was supposed to - # compile, fail. - if {$compile_errors > 0} { - if {$compile == 1} { - fail "$TEST_NAME compilation failed" - } else { - pass "$TEST_NAME compilation failed correctly" - } - } else { - if {$compile == 1} { - pass "$TEST_NAME compilation succeeded" - } else { - fail "$TEST_NAME compilation succeeded unexpectedly" - } - } -} - # Initialize variables set kernel_markers_found 0 set kernel_marker_names {} |