summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.base/tapset_includes.exp
diff options
context:
space:
mode:
authorJosh Stone <jistone@redhat.com>2009-08-27 15:43:51 -0700
committerJosh Stone <jistone@redhat.com>2009-08-27 15:50:07 -0700
commita3b4f52cd67ff11dfc12e8e878744ea1319308ef (patch)
tree56e1de369a44e58104013d07e1cec93748d3c6f5 /testsuite/systemtap.base/tapset_includes.exp
parent59996ccdab9c43ac0f5603faabfa9f83746e346a (diff)
downloadsystemtap-steved-a3b4f52cd67ff11dfc12e8e878744ea1319308ef.tar.gz
systemtap-steved-a3b4f52cd67ff11dfc12e8e878744ea1319308ef.tar.xz
systemtap-steved-a3b4f52cd67ff11dfc12e8e878744ea1319308ef.zip
PR10568: Ensure that aliases pull in their tapset
When a probe alias is resolved in a tapset, the contents of that tapset should be included in the compiled script, just as we do for global variables and functions. * elaborate.cxx (alias_expansion_builder::build): When an alias is instantiated, add its stapfile to the session files. * testsuite/systemtap.base/tapset_includes.exp: New test. * testsuite/systemtap.base/tapset/*.stp: Testing tapsets for above.
Diffstat (limited to 'testsuite/systemtap.base/tapset_includes.exp')
-rw-r--r--testsuite/systemtap.base/tapset_includes.exp21
1 files changed, 21 insertions, 0 deletions
diff --git a/testsuite/systemtap.base/tapset_includes.exp b/testsuite/systemtap.base/tapset_includes.exp
new file mode 100644
index 00000000..06957e09
--- /dev/null
+++ b/testsuite/systemtap.base/tapset_includes.exp
@@ -0,0 +1,21 @@
+# Check that globals, functions, and aliases will pull in probes from the
+# tapset file in which they are defined.
+
+if {![installtest_p]} { untested "tapset includes"; return }
+
+set tapset "$srcdir/$subdir/tapset"
+
+# global
+set script "probe end { if (test_global) println(\"end\") }"
+set ::result_string "included global\nend"
+stap_run_exact "tapset include global" -I$tapset -e $script -c true
+
+# function
+set script "probe end { if (test_function()) println(\"end\") }"
+set ::result_string "included function\nend"
+stap_run_exact "tapset include function" -I$tapset -e $script -c true
+
+# alias
+set script "probe test_alias { if (alias_local) println(\"end\") }"
+set ::result_string "included alias\nend"
+stap_run_exact "tapset include alias" -I$tapset -e $script -c true