diff options
Diffstat (limited to 'testsuite/systemtap.base')
-rw-r--r-- | testsuite/systemtap.base/print.exp | 5 | ||||
-rw-r--r-- | testsuite/systemtap.base/print.stp | 39 |
2 files changed, 44 insertions, 0 deletions
diff --git a/testsuite/systemtap.base/print.exp b/testsuite/systemtap.base/print.exp new file mode 100644 index 00000000..9158a296 --- /dev/null +++ b/testsuite/systemtap.base/print.exp @@ -0,0 +1,5 @@ +# Test that all the print statements work + +set test "print" + +stap_run $srcdir/$subdir/$test.stp no_load $all_pass_string diff --git a/testsuite/systemtap.base/print.stp b/testsuite/systemtap.base/print.stp new file mode 100644 index 00000000..e1b64c35 --- /dev/null +++ b/testsuite/systemtap.base/print.stp @@ -0,0 +1,39 @@ +/* + * print.stp + * + * Test that all the print statements work + */ + +global s1, s2, s3 + +probe begin +{ + log("systemtap starting probe") + s1 = "systemtap" + s2 = "test" + s3 = "success" +} + +probe end +{ + log("systemtap ending probe") + + print(s1, " ", s2, " ", s3, "\n") + print(sprint(s1, " ", s2, " ", s3, "\n")) + + println(s1, " ", s2, " ", s3) + print(sprintln(s1, " ", s2, " ", s3)) + + printd(" ", s1, s2, s3 . "\n") + print(sprintd(" ", s1, s2, s3 . "\n")) + + printdln(" ", s1, s2, s3) + print(sprintdln(" ", s1, s2, s3)) + + // check that formatting characters get escaped correctly in the delimiter + s = sprintd("%% % \\ \"", 1, 2, 3) + if (s == "1%% % \\ \"2%% % \\ \"3") + log("systemtap test success") + else + log("systemtap test failure") +} |