diff options
Diffstat (limited to 'testsuite/systemtap.examples/check.exp')
-rw-r--r-- | testsuite/systemtap.examples/check.exp | 44 |
1 files changed, 23 insertions, 21 deletions
diff --git a/testsuite/systemtap.examples/check.exp b/testsuite/systemtap.examples/check.exp index 2ac43050..14d9a57e 100644 --- a/testsuite/systemtap.examples/check.exp +++ b/testsuite/systemtap.examples/check.exp @@ -32,6 +32,23 @@ proc extract_tag { META_DATA TAG } { return $value } +proc run_command { test command } { + #FIXME tcl says that single quotes not dealt with + if { $command != "" } then { + verbose -log "attempting command $command" + set res [catch {eval exec $command} value] + verbose -log "OUT $value" + verbose -log "RC $res" + if {$res != 0 } { + fail $test + } else { + pass $test + } + } else { + untested $test + } +} + set curdir [pwd] set src_examples $srcdir/systemtap.examples @@ -39,36 +56,21 @@ set meta_files [lsort [exec find $src_examples -path "*.meta"]] foreach file $meta_files { set dir [file dirname $file] set test [regsub {.*/testsuite/} $file ""] + set test [regsub {.meta} $test ""] 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_installcheck [extract_tag "$meta_data" "test_installcheck"] - # Would like to run the tests (-p5), but pass fail logic too - # simple and fails for many examples - # FIXME following line prevents installcheck with "--tools_opts install" - set 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 - } else { - set command $test_check - } - - #FIXME tcl says that single quotes not dealt with - if { $command != "" } then { - verbose -log "attempting command $command" - set res [catch {eval exec $command} value] - verbose -log "OUT $value" - verbose -log "RC $res" - if {$res != 0 } { - fail $test - } else { - pass $test - } - } else { - untested $test + run_command "$test run" $command } } |