public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 1/3] Add more case for -p
@ 2015-12-10 10:43 Zhou Wenjian
  2015-12-10 10:43 ` [PATCH 3/3] Add new case for -k Zhou Wenjian
  2015-12-10 10:43 ` [PATCH 2/3] Add more case for typemismatch Zhou Wenjian
  0 siblings, 2 replies; 4+ messages in thread
From: Zhou Wenjian @ 2015-12-10 10:43 UTC (permalink / raw)
  To: systemtap

	* testsuite/parseko/cmdline01.stp: new test case
---
 testsuite/parseko/cmdline01.stp | 8 ++++++++
 1 file changed, 8 insertions(+)
 create mode 100755 testsuite/parseko/cmdline01.stp

diff --git a/testsuite/parseko/cmdline01.stp b/testsuite/parseko/cmdline01.stp
new file mode 100755
index 0000000..3a80e8f
--- /dev/null
+++ b/testsuite/parseko/cmdline01.stp
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+# -p NUM Stop after pass NUM.  The passes are numbered 1-5: parse, elabo-
+#        rate,  translate,  compile, run.
+#
+# NUM must be between 1 and 5
+
+stap $@ -p6 -e 'probe begin { exit() }'
-- 
1.8.3.1



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 3/3] Add new case for -k
  2015-12-10 10:43 [PATCH 1/3] Add more case for -p Zhou Wenjian
@ 2015-12-10 10:43 ` Zhou Wenjian
  2015-12-23 15:53   ` David Smith
  2015-12-10 10:43 ` [PATCH 2/3] Add more case for typemismatch Zhou Wenjian
  1 sibling, 1 reply; 4+ messages in thread
From: Zhou Wenjian @ 2015-12-10 10:43 UTC (permalink / raw)
  To: systemtap

	* testsuite/systemtap.base/temp-directory.exp: new test case
---
 testsuite/systemtap.base/temp-directory.exp | 37 +++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)
 create mode 100644 testsuite/systemtap.base/temp-directory.exp

diff --git a/testsuite/systemtap.base/temp-directory.exp b/testsuite/systemtap.base/temp-directory.exp
new file mode 100644
index 0000000..66a629f
--- /dev/null
+++ b/testsuite/systemtap.base/temp-directory.exp
@@ -0,0 +1,37 @@
+# Check keep temporary directory
+set test "keep temporary directory"
+#if {![installtest_p]} { untested "$test"; return }
+
+# Script we'll use while testing:
+set script "probe begin{exit();}"
+set ret 0
+
+spawn stap -k -e $script
+expect {
+-re {Keeping temporary directory \"((/[0-9a-zA-Z]*)+)\"\r\n} {set dir $expect_out(1,string); exp_continue}
+eof
+}
+
+if { [file isdirectory $dir] == 1 } {
+	exec rm -rf $dir
+} else {
+	set ret 1
+}
+
+spawn stap -k -p1 -e $script
+expect {
+-re {Keeping temporary directory \"((/[0-9a-zA-Z]*)+)\"\r\n} {set dir $expect_out(1,string); exp_continue}
+eof
+}
+
+if { [file isdirectory $dir] == 1 } {
+	exec rm -rf $dir
+} else {
+	set ret 1
+}
+
+if { $ret == 0 } {
+	pass $test
+} else {
+	fail $test
+}
-- 
1.8.3.1



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 2/3] Add more case for typemismatch
  2015-12-10 10:43 [PATCH 1/3] Add more case for -p Zhou Wenjian
  2015-12-10 10:43 ` [PATCH 3/3] Add new case for -k Zhou Wenjian
@ 2015-12-10 10:43 ` Zhou Wenjian
  1 sibling, 0 replies; 4+ messages in thread
From: Zhou Wenjian @ 2015-12-10 10:43 UTC (permalink / raw)
  To: systemtap

	* testsuite/semko/typemismatch5.stp: add more case
---
 testsuite/semko/typemismatch5.stp | 11 +++++++++++
 1 file changed, 11 insertions(+)
 create mode 100755 testsuite/semko/typemismatch5.stp

diff --git a/testsuite/semko/typemismatch5.stp b/testsuite/semko/typemismatch5.stp
new file mode 100755
index 0000000..37dc5c9
--- /dev/null
+++ b/testsuite/semko/typemismatch5.stp
@@ -0,0 +1,11 @@
+#! stap -p2
+
+global array
+
+probe begin
+{
+	array[3] = 2015
+	array[5] = "2015"
+	print(array[3])
+	print(array[5])
+}
-- 
1.8.3.1



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 3/3] Add new case for -k
  2015-12-10 10:43 ` [PATCH 3/3] Add new case for -k Zhou Wenjian
@ 2015-12-23 15:53   ` David Smith
  0 siblings, 0 replies; 4+ messages in thread
From: David Smith @ 2015-12-23 15:53 UTC (permalink / raw)
  To: Zhou Wenjian, systemtap

On 12/10/2015 04:41 AM, Zhou Wenjian wrote:
> 	* testsuite/systemtap.base/temp-directory.exp: new test case

I've checked these 3 tests in, with a couple of small tweaks:

- I changed the name of 'cmdline01.stp' to 'cmdline24.stp'. We try to
not reuse the names of deleted tests (since it makes comparing test
results tricky).

- I make a couple of changes to temp-directory.exp. I make sure to call
"wait" and "close" after each spawn (which is required by expect). I
also rearranged the test so that we run the '-p1' test always and the
full script only if we're doing a "make installcheck".

Thanks again.

-- 
David Smith
dsmith@redhat.com
Red Hat
http://www.redhat.com
256.217.0141 (direct)
256.837.0057 (fax)

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-12-23 15:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-10 10:43 [PATCH 1/3] Add more case for -p Zhou Wenjian
2015-12-10 10:43 ` [PATCH 3/3] Add new case for -k Zhou Wenjian
2015-12-23 15:53   ` David Smith
2015-12-10 10:43 ` [PATCH 2/3] Add more case for typemismatch Zhou Wenjian

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).