From 805006f778928f9d43419c3ad0f9e6cd0e9df9c0 Mon Sep 17 00:00:00 2001 From: hunt Date: Thu, 25 Oct 2007 18:40:37 +0000 Subject: 2007-10-25 Martin Hunt * systemtap.printf/printd.stp: New * systemtap.printf/printdln.stp: New --- testsuite/systemtap.printf/printd.stp | 46 +++++++++++++++++++++++++++++++++ testsuite/systemtap.printf/printdln.stp | 33 +++++++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 testsuite/systemtap.printf/printd.stp create mode 100644 testsuite/systemtap.printf/printdln.stp (limited to 'testsuite/systemtap.printf') diff --git a/testsuite/systemtap.printf/printd.stp b/testsuite/systemtap.printf/printd.stp new file mode 100644 index 00000000..500b0600 --- /dev/null +++ b/testsuite/systemtap.printf/printd.stp @@ -0,0 +1,46 @@ +# test the printd function with string and integers, +# variables and constants. + +probe begin { + a = "hello" + b = " " + c = "world" + d = 777 + e = "<-->" + + # print variables + printd(b,a) + println("") + printd(b,a,c) + println("") + printd(e,a,c,d) + println("") + + # print literals + printd(",","foo") + println("") + printd(" *** ","foo","bar") + println("") + printd(" *** ","foo","bar","baz") + println("") + + printd(", " , 777) + println("") + printd(",","foo",99) + println("") + println(",",99, "foo") + println("") + + printd("",123,456,789) + println("") + printd(" ",123,456,789) + println("") + + # mixed + printd("-",a,999) + println("") + printd("-",999,a) + println("") + + exit() +} diff --git a/testsuite/systemtap.printf/printdln.stp b/testsuite/systemtap.printf/printdln.stp new file mode 100644 index 00000000..86886ac1 --- /dev/null +++ b/testsuite/systemtap.printf/printdln.stp @@ -0,0 +1,33 @@ +# test the printdln function with string and integers, +# variables and constants. + +probe begin { + a = "hello" + b = " " + c = "world" + d = 777 + e = "<-->" + + # print variables + printdln(b,a) + printdln(b,a,c) + printdln(e,a,c,d) + + # print literals + printdln(",","foo") + printdln(" *** ","foo","bar") + printdln(" *** ","foo","bar","baz") + + printdln(", " , 777) + printdln(",","foo",99) + println(",",99, "foo") + + printdln("",123,456,789) + printdln(" ",123,456,789) + + # mixed + printdln("-",a,999) + printdln("-",999,a) + + exit() +} -- cgit From 0379c17346059afa8dffb07eef82eaea726be6d2 Mon Sep 17 00:00:00 2001 From: hunt Date: Thu, 25 Oct 2007 22:22:16 +0000 Subject: 2007-10-25 Martin Hunt * systemtap.printf/print_char.*: New test. * systemtap.printf/print.*: New test. * systemtap.printf/println.*: New test. * systemtap.maps/elision.*: New tests. * config/unix.exp: Added stap_run_exact. * lib/stap_run_exact.exp: New. Like stap_run2 but takes a seperate test name. --- testsuite/systemtap.printf/print.exp | 18 ++++++++++++ testsuite/systemtap.printf/print.stp | 47 +++++++++++++++++++++++++++++++ testsuite/systemtap.printf/print_char.exp | 5 ++++ testsuite/systemtap.printf/print_char.stp | 16 +++++++++++ testsuite/systemtap.printf/println.exp | 18 ++++++++++++ testsuite/systemtap.printf/println.stp | 37 ++++++++++++++++++++++++ 6 files changed, 141 insertions(+) create mode 100644 testsuite/systemtap.printf/print.exp create mode 100644 testsuite/systemtap.printf/print.stp create mode 100644 testsuite/systemtap.printf/print_char.exp create mode 100644 testsuite/systemtap.printf/print_char.stp create mode 100644 testsuite/systemtap.printf/println.exp create mode 100644 testsuite/systemtap.printf/println.stp (limited to 'testsuite/systemtap.printf') diff --git a/testsuite/systemtap.printf/print.exp b/testsuite/systemtap.printf/print.exp new file mode 100644 index 00000000..3a4de529 --- /dev/null +++ b/testsuite/systemtap.printf/print.exp @@ -0,0 +1,18 @@ +set test "print" +set ::result_string {hello world +777 +hello world +hello world +foo +foobar +foobar +foobar +foo99 +99foo +777 +888 +123456789 +hello999 +999hello +} +stap_run2 $srcdir/$subdir/$test.stp diff --git a/testsuite/systemtap.printf/print.stp b/testsuite/systemtap.printf/print.stp new file mode 100644 index 00000000..ae770935 --- /dev/null +++ b/testsuite/systemtap.printf/print.stp @@ -0,0 +1,47 @@ +# test the print function with string and integers, +# variables and constants. + +probe begin { + a = "hello" + b = " " + c = "world" + d = 777 + + # print variables + print(a) + print(b) + print(c) + print("\n") + + print(d) + print("\n") + + print(a,b,c,"\n") + print(a.b.c."\n") + + # print literals + print("foo") + print("\n") + + print("foo") + print("bar") + print("\n") + + print("foo","bar","\n") + print("foo"."bar"."\n") + + print("foo",99,"\n") + print(99, "foo","\n") + + print(777) + print("\n") + print(888,"\n") + + print(123,456,789,"\n") + + # mixed + print(a,999,"\n") + print(999,a,"\n") + + exit() +} diff --git a/testsuite/systemtap.printf/print_char.exp b/testsuite/systemtap.printf/print_char.exp new file mode 100644 index 00000000..bab056dd --- /dev/null +++ b/testsuite/systemtap.printf/print_char.exp @@ -0,0 +1,5 @@ +set test "print_char" +set ::result_string {ABC +ABCDEFGHIJKLMNOPQRSTUVWXYZ +} +stap_run2 $srcdir/$subdir/$test.stp diff --git a/testsuite/systemtap.printf/print_char.stp b/testsuite/systemtap.printf/print_char.stp new file mode 100644 index 00000000..0900fe1d --- /dev/null +++ b/testsuite/systemtap.printf/print_char.stp @@ -0,0 +1,16 @@ +# test the print_char function + +probe begin { + endl = 10 + print_char(65) + print_char(66) + print_char(67) + print_char(endl) + + for (i = 65; i < 91; i++) + print_char(i) + print_char(endl) + + + exit() +} diff --git a/testsuite/systemtap.printf/println.exp b/testsuite/systemtap.printf/println.exp new file mode 100644 index 00000000..8deba53f --- /dev/null +++ b/testsuite/systemtap.printf/println.exp @@ -0,0 +1,18 @@ +set test "println" +set ::result_string {hello + +world +777 +hello world +hello world +foo +foobar +foobar +777 +foo99 +99foo +123456789 +hello999 +999hello +} +stap_run2 $srcdir/$subdir/$test.stp diff --git a/testsuite/systemtap.printf/println.stp b/testsuite/systemtap.printf/println.stp new file mode 100644 index 00000000..0b02f0ac --- /dev/null +++ b/testsuite/systemtap.printf/println.stp @@ -0,0 +1,37 @@ +# test the println function with string and integers, +# variables and constants. + +probe begin { + a = "hello" + b = " " + c = "world" + d = 777 + + # println variables + println(a) + println(b) + println(c) + + println(d) + + println(a,b,c) + println(a.b.c) + + # println literals + println("foo") + + println("foo","bar") + println("foo"."bar") + + println(777) + println("foo",99) + println(99, "foo") + + println(123,456,789) + + # mixed + println(a,999) + println(999,a) + + exit() +} -- cgit From 911d9d8053f60da72391bc73d552ea45b86308dd Mon Sep 17 00:00:00 2001 From: hunt Date: Fri, 26 Oct 2007 01:06:11 +0000 Subject: 2007-10-25 Martin Hunt * systemtap.printf/printd.exp: New. Runs printd.stp and printdln.stp. * systemtap.printf/printdln.stp: Removed bad tests. * systemtap.printf/printd.stp: Ditto. --- testsuite/systemtap.printf/printd.exp | 20 ++++++++++++++++++++ testsuite/systemtap.printf/printd.stp | 16 +++------------- testsuite/systemtap.printf/printdln.stp | 12 +++--------- 3 files changed, 26 insertions(+), 22 deletions(-) create mode 100644 testsuite/systemtap.printf/printd.exp (limited to 'testsuite/systemtap.printf') diff --git a/testsuite/systemtap.printf/printd.exp b/testsuite/systemtap.printf/printd.exp new file mode 100644 index 00000000..5ba90341 --- /dev/null +++ b/testsuite/systemtap.printf/printd.exp @@ -0,0 +1,20 @@ +# printd and printdln tests + +# both tests have the same result + +set ::result_string {hello world +hello<-->world<-->777 +foo *** bar +foo *** bar *** baz +foo,99 +99,foo +123 456 789 +hello-999 +999-hello +} + +foreach x {"d" "dln"} { + set test "print$x" + stap_run_exact $test $srcdir/$subdir/$test.stp +} + diff --git a/testsuite/systemtap.printf/printd.stp b/testsuite/systemtap.printf/printd.stp index 500b0600..8dcff3f5 100644 --- a/testsuite/systemtap.printf/printd.stp +++ b/testsuite/systemtap.printf/printd.stp @@ -3,36 +3,26 @@ probe begin { a = "hello" - b = " " c = "world" d = 777 - e = "<-->" # print variables - printd(b,a) + printd(" ",a,c) println("") - printd(b,a,c) - println("") - printd(e,a,c,d) + printd("<-->",a,c,d) println("") # print literals - printd(",","foo") - println("") printd(" *** ","foo","bar") println("") printd(" *** ","foo","bar","baz") println("") - printd(", " , 777) - println("") printd(",","foo",99) println("") - println(",",99, "foo") + printd(",",99, "foo") println("") - printd("",123,456,789) - println("") printd(" ",123,456,789) println("") diff --git a/testsuite/systemtap.printf/printdln.stp b/testsuite/systemtap.printf/printdln.stp index 86886ac1..ed78eac5 100644 --- a/testsuite/systemtap.printf/printdln.stp +++ b/testsuite/systemtap.printf/printdln.stp @@ -3,26 +3,20 @@ probe begin { a = "hello" - b = " " c = "world" d = 777 - e = "<-->" # print variables - printdln(b,a) - printdln(b,a,c) - printdln(e,a,c,d) + printdln(" ",a,c) + printdln("<-->",a,c,d) # print literals - printdln(",","foo") printdln(" *** ","foo","bar") printdln(" *** ","foo","bar","baz") - printdln(", " , 777) printdln(",","foo",99) - println(",",99, "foo") + printdln(",",99, "foo") - printdln("",123,456,789) printdln(" ",123,456,789) # mixed -- cgit