summaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/ChangeLog10
-rwxr-xr-xtestsuite/semko/twelve.stp4
-rwxr-xr-xtestsuite/semok/optimize.stp18
-rwxr-xr-xtestsuite/semok/twenty.stp2
-rw-r--r--testsuite/systemtap.base/cache.exp4
-rw-r--r--testsuite/systemtap.base/maxactive.exp6
-rw-r--r--testsuite/systemtap.base/warnings.exp4
-rw-r--r--testsuite/systemtap.examples/ChangeLog3
-rw-r--r--testsuite/systemtap.examples/check.exp75
-rw-r--r--testsuite/systemtap.pass1-4/buildok.exp2
-rwxr-xr-xtestsuite/transok/eight.stp3
11 files changed, 118 insertions, 13 deletions
diff --git a/testsuite/ChangeLog b/testsuite/ChangeLog
index b8fe2db6..c951971b 100644
--- a/testsuite/ChangeLog
+++ b/testsuite/ChangeLog
@@ -1,3 +1,13 @@
+2008-04-29 Frank Ch. Eigler <fche@elastic.org>
+
+ PR 6466.
+ * semko/twelve.stp, semok/twenty.stp, systemtap.base/cache.exp,
+ systemtap.base/maxactive.exp, systemtap.base/warnings.exp,
+ transok/eight.stp: Adapt to new elision capabilities; add new
+ side-effects or -w warning-suppression flags.
+ * systemtap.pass1-4/buildok.exp: Remove two kfails.
+ * semok/optimize.stp: Test new elision.
+
2008-04-24 Will Cohen <wcohen@redhat.com>
* systemtap.examples: examples moved into testsuite.
diff --git a/testsuite/semko/twelve.stp b/testsuite/semko/twelve.stp
index ab71d579..c91eb743 100755
--- a/testsuite/semko/twelve.stp
+++ b/testsuite/semko/twelve.stp
@@ -1,6 +1,6 @@
#! stap -p2
probe end {
- for (a=0; "hello";) {}
- while ("goodbye") {}
+ for (a=0; "hello";) {println("hello")}
+ while ("goodbye") {println("world")}
}
diff --git a/testsuite/semok/optimize.stp b/testsuite/semok/optimize.stp
index bcf8ac04..a728bd66 100755
--- a/testsuite/semok/optimize.stp
+++ b/testsuite/semok/optimize.stp
@@ -1,4 +1,4 @@
-#! stap -p2
+#! stap -wp2
# We count on the optimizer to blow away these ridiculous
# expressions, since they have no effect on the output.
@@ -21,3 +21,19 @@ probe begin {
probe begin{for(i=1;i-=2;i++);}
probe begin{while(i+=2);}
probe begin{if(i=j);}
+
+global ii
+probe begin{for(ii=1;ii-=2;ii++);}
+probe begin{while(ii+=2);}
+probe begin{if(ii=j);}
+
+# bug #6466
+global goo
+
+probe begin { while (24) ; }
+probe begin { for (2<$i; zoo(333); poo) ; }
+probe begin { foreach (x in goo) goo[x]+1; }
+probe begin { foo = $bar; if (foo) {} }
+probe begin { { { { } } } }
+function useful () { return 1 }
+probe begin { println (useful()) } /* don't elide this one! */
diff --git a/testsuite/semok/twenty.stp b/testsuite/semok/twenty.stp
index 2e85c5e6..46dcefca 100755
--- a/testsuite/semok/twenty.stp
+++ b/testsuite/semok/twenty.stp
@@ -1,4 +1,4 @@
-#! stap -p2
+#! stap -wp2
probe kernel.function("*") {}
probe module("*").function("*") {}
diff --git a/testsuite/systemtap.base/cache.exp b/testsuite/systemtap.base/cache.exp
index eaa5ca82..26d7b0ef 100644
--- a/testsuite/systemtap.base/cache.exp
+++ b/testsuite/systemtap.base/cache.exp
@@ -74,8 +74,8 @@ if [info exists env(SYSTEMTAP_DIR)] {
set env(SYSTEMTAP_DIR) $local_systemtap_dir
# Set up the scripts we'll use.
-set basic_script1 "\"probe begin { }\""
-set basic_script2 "\"probe begin, end { }\""
+set basic_script1 "\"probe begin { println(1) }\""
+set basic_script2 "\"probe begin, end { println(2) }\""
set error_script "\"probe XbeginX { }\""
# Check basic functionality. The 1st compilation of a script won't
diff --git a/testsuite/systemtap.base/maxactive.exp b/testsuite/systemtap.base/maxactive.exp
index ca95ac53..7c03a1bf 100644
--- a/testsuite/systemtap.base/maxactive.exp
+++ b/testsuite/systemtap.base/maxactive.exp
@@ -13,8 +13,9 @@ proc sleep_five_sec {} {
# Script1. For 5 seconds, probe the return of "sys_select" and
# "sys_read". See if we skip any probes.
set script1 {
+ global foo
probe kernel.function("sys_select").return,
- kernel.function("sys_read").return { }
+ kernel.function("sys_read").return { foo++ }
probe timer.ms(5000) { exit(); }
probe begin { log("systemtap starting probe"); log("systemtap ending probe");}
@@ -29,8 +30,9 @@ set skipped1 $skipped_probes
# "sys_read", with a limit of 1 probe active at a time. See if we
# skip any probes.
set script2 {
+ global foo
probe kernel.function("sys_select").return.maxactive(1),
- kernel.function("sys_read").return.maxactive(1) { }
+ kernel.function("sys_read").return.maxactive(1) { foo++ }
probe timer.ms(5000) { exit(); }
probe begin { log("systemtap starting probe"); log("systemtap ending probe");}
diff --git a/testsuite/systemtap.base/warnings.exp b/testsuite/systemtap.base/warnings.exp
index 90409d18..025bde89 100644
--- a/testsuite/systemtap.base/warnings.exp
+++ b/testsuite/systemtap.base/warnings.exp
@@ -9,8 +9,8 @@ expect {
eof { }
}
wait
-if {$ok == 6} {
+if {$ok == 9} {
pass $test
} else {
- fail $test
+ fail "$test ($ok)"
}
diff --git a/testsuite/systemtap.examples/ChangeLog b/testsuite/systemtap.examples/ChangeLog
index 78083901..c85a43ee 100644
--- a/testsuite/systemtap.examples/ChangeLog
+++ b/testsuite/systemtap.examples/ChangeLog
@@ -1,3 +1,6 @@
+2008-04-27 William Cohen <wcohen@redhat.com>
+
+ * check.exp: New script to run tests on cataloged examples.
2008-03-09 Wenji Huang <wenji.huang@oracle.com>
diff --git a/testsuite/systemtap.examples/check.exp b/testsuite/systemtap.examples/check.exp
new file mode 100644
index 00000000..2ac43050
--- /dev/null
+++ b/testsuite/systemtap.examples/check.exp
@@ -0,0 +1,75 @@
+# check.exp
+#
+# This script searches the systemtap.examples directory for .meta files
+# The .meta files contain information categorizing the script. The
+# .meta files are composed of lines of tags. Each tag is followed by a
+# value.
+
+#open the file and read in all the lines of data in FILE
+#return a string with the data
+proc get_meta_data { FILE } {
+ set meta_data ""
+
+ if [catch {open "$FILE" RDONLY} fl] {
+ puts "open $FILE failed: $err"
+ return ""
+ } else {
+ set meta_data [read -nonewline $fl]
+ close $fl
+ return "$meta_data"
+ }
+}
+
+#extract value for TAG from string META_DATA
+#if there is no matching tag return ""
+proc extract_tag { META_DATA TAG } {
+ set taglines ""
+ set value ""
+ set expr "^$TAG:\[^\$\]*"
+ regexp -line -all $expr $META_DATA taglines
+ set expr "$TAG:"
+ regsub -line $expr $taglines "" value
+ return $value
+}
+
+set curdir [pwd]
+
+set src_examples $srcdir/systemtap.examples
+set meta_files [lsort [exec find $src_examples -path "*.meta"]]
+foreach file $meta_files {
+ set dir [file dirname $file]
+ set test [regsub {.*/testsuite/} $file ""]
+
+ cd $dir
+
+ set meta_data [get_meta_data $file]
+ set test_check [extract_tag "$meta_data" "test_check"]
+ 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 ""
+ 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
+ }
+}
+
+cd $curdir
diff --git a/testsuite/systemtap.pass1-4/buildok.exp b/testsuite/systemtap.pass1-4/buildok.exp
index 77e77181..07580550 100644
--- a/testsuite/systemtap.pass1-4/buildok.exp
+++ b/testsuite/systemtap.pass1-4/buildok.exp
@@ -8,9 +8,7 @@ foreach file [lsort [glob -nocomplain $srcdir/$self/*.stp]] {
buildok/perfmon01.stp {setup_kfail 909 *-*-*}
buildok/twentysix.stp {setup_kfail 4105 *-*-*}
buildok/twentyseven.stp {setup_kfail 4166 *-*-*}
- buildok/process_test.stp {setup_kfail 1155 *-*-*}
buildok/sched_test.stp {setup_kfail 1155 *-*-*}
- buildok/socket.stp {setup_kfail 4413 *-*-*}
}
if {$rc == 0} { pass $test } else { fail $test }
}
diff --git a/testsuite/transok/eight.stp b/testsuite/transok/eight.stp
index 6723b993..9198536e 100755
--- a/testsuite/transok/eight.stp
+++ b/testsuite/transok/eight.stp
@@ -2,10 +2,11 @@
global foo
global baz
+global zoo
function bar()
{
- return foo["hello"]
+ return foo["hello"]+(zoo++)
}
probe begin