summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.examples/check.exp
diff options
context:
space:
mode:
authorWenji Huang <wenji.huang@oracle.com>2009-09-08 18:38:14 -0400
committerWenji Huang <wenji.huang@oracle.com>2009-09-08 18:38:14 -0400
commit2de206d6b209e5e3b518f38c9991e4434940f72e (patch)
tree0c1908efd5c766726940b8ac26b5e343bf573a1e /testsuite/systemtap.examples/check.exp
parente13354499dbd1f854040bc120bdfd1d0fc9ff6b3 (diff)
downloadsystemtap-steved-2de206d6b209e5e3b518f38c9991e4434940f72e.tar.gz
systemtap-steved-2de206d6b209e5e3b518f38c9991e4434940f72e.tar.xz
systemtap-steved-2de206d6b209e5e3b518f38c9991e4434940f72e.zip
PR10604: check availability for example test cases
* testsuite/systemtap.examples/check.exp: Handle with test_support. * testsuite/systemtap.examples/io/iostat-scsi.meta: Add meta-tag test_support. * testsuite/systemtap.examples/memory/mmanonpage.meta: Ditto. * testsuite/systemtap.examples/memory/mmfilepage.meta: Ditto. * testsuite/systemtap.examples/memory/mmreclaim.meta: Ditto. * testsuite/systemtap.examples/memory/mmwriteback.meta: Ditto. * testsuite/systemtap.examples/network/autofs4.meta: Ditto. * testsuite/systemtap.examples/network/dropwatch.meta: Ditto. * testsuite/systemtap.examples/process/schedtimes.meta: Ditto.
Diffstat (limited to 'testsuite/systemtap.examples/check.exp')
-rw-r--r--testsuite/systemtap.examples/check.exp40
1 files changed, 30 insertions, 10 deletions
diff --git a/testsuite/systemtap.examples/check.exp b/testsuite/systemtap.examples/check.exp
index 482738cc..0fad597d 100644
--- a/testsuite/systemtap.examples/check.exp
+++ b/testsuite/systemtap.examples/check.exp
@@ -32,7 +32,7 @@ proc extract_tag { META_DATA TAG } {
return $value
}
-proc run_command { test command } {
+proc run_command { test action command } {
#FIXME tcl says that single quotes not dealt with
if { $command != "" } then {
verbose -log "attempting command $command"
@@ -42,13 +42,16 @@ proc run_command { test command } {
set res [catch {eval exec "$command |& cat"} value]
verbose -log "OUT $value"
verbose -log "RC $res"
- if {$res != 0 } {
- fail $test
+ if { $res != 0 } { # allow failure for support
+ if { $action != "support" } { fail "$test $action" }
+ return $res
} else {
- pass $test
+ pass "$test $action"
+ return $res
}
} else {
- untested $test
+ untested "$test $action"
+ return 0
}
}
@@ -64,16 +67,33 @@ foreach file $meta_files {
cd $dir
set meta_data [get_meta_data $file]
- set test_check [extract_tag "$meta_data" "test_check"]
- set command $test_check
- run_command "$test build" $command
+ set test_support [extract_tag "$meta_data" "test_support"]
+ set command $test_support
+ set supported_p 1
+ if { $command != "" } { # need to test support
+ set res [run_command "$test" "support" $command]
+ if { $res != 0 } { set supported_p 0 }
+ }
+
+ if { $supported_p == 1 } {
+ set test_check [extract_tag "$meta_data" "test_check"]
+ set command $test_check
+ run_command "$test" "build" $command
+ } else {
+ untested "$test build"
+ }
+
set test_installcheck [extract_tag "$meta_data" "test_installcheck"]
# The pass/fail logic too simple and fails for some examples
# FIXME would like to be able to run more complicated test code
if {[info procs installtest_p] != "" && [installtest_p]
&& $test_installcheck != "" } then {
- set command $test_installcheck
- run_command "$test run" $command
+ if { $supported_p == 1 } {
+ set command $test_installcheck
+ run_command "$test" "run" $command
+ } else {
+ untested "$test run"
+ }
}
}