summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.examples
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/systemtap.examples')
-rw-r--r--testsuite/systemtap.examples/ChangeLog8
-rw-r--r--testsuite/systemtap.examples/check.exp44
-rw-r--r--testsuite/systemtap.examples/helloworld.meta2
-rw-r--r--testsuite/systemtap.examples/traceio2.meta2
4 files changed, 33 insertions, 23 deletions
diff --git a/testsuite/systemtap.examples/ChangeLog b/testsuite/systemtap.examples/ChangeLog
index d75ad014..7cb39fb9 100644
--- a/testsuite/systemtap.examples/ChangeLog
+++ b/testsuite/systemtap.examples/ChangeLog
@@ -1,3 +1,11 @@
+2008-08-01 William Cohen <wcohen@redhat.com>
+
+ * helloworld.meta, traceio2.meta: Tweak test_installcheck.
+
+2008-08-01 William Cohen <wcohen@redhat.com>
+
+ * check.exp: Run both tests for installcheck tests.
+
2008-07-11 Mark Wielaard <mwielaard@redhat.com>
* traceio.meta: s/decending/descending/ in description.
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
}
}
diff --git a/testsuite/systemtap.examples/helloworld.meta b/testsuite/systemtap.examples/helloworld.meta
index f56b7ca3..60bc53f2 100644
--- a/testsuite/systemtap.examples/helloworld.meta
+++ b/testsuite/systemtap.examples/helloworld.meta
@@ -10,4 +10,4 @@ output: text
scope: system-wide
description: A basic "Hello World" program implemented in SystemTap script. It prints out "hello world" message and then immediately exits.
test_check: stap -p4 helloworld.stp
-test_installcheck: stap helloworld.stp -c "sleep 1"
+test_installcheck: stap helloworld.stp
diff --git a/testsuite/systemtap.examples/traceio2.meta b/testsuite/systemtap.examples/traceio2.meta
index e6bca1a9..4b63108c 100644
--- a/testsuite/systemtap.examples/traceio2.meta
+++ b/testsuite/systemtap.examples/traceio2.meta
@@ -10,4 +10,4 @@ output: trace
scope: system-wide
description: Print out the executable name and process number as reads and writes to the specified device occur.
test_check: stap -p4 traceio2.stp 0x0801
-test_installcheck: /bin/sh eval stap traceio2.stp 0x0801 -c "sleep 1"
+test_installcheck: stap traceio2.stp 0x0801 -c "sleep 1"