public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: Zhou Wenjian <zhouwj-fnst@cn.fujitsu.com>
To: <systemtap@sourceware.org>
Subject: [PATCH 3/3] Add new case for -k
Date: Thu, 10 Dec 2015 10:43:00 -0000	[thread overview]
Message-ID: <1449744091-1673-3-git-send-email-zhouwj-fnst@cn.fujitsu.com> (raw)
In-Reply-To: <1449744091-1673-1-git-send-email-zhouwj-fnst@cn.fujitsu.com>

	* 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



  reply	other threads:[~2015-12-10 10:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-10 10:43 [PATCH 1/3] Add more case for -p Zhou Wenjian
2015-12-10 10:43 ` Zhou Wenjian [this message]
2015-12-23 15:53   ` [PATCH 3/3] Add new case for -k David Smith
2015-12-10 10:43 ` [PATCH 2/3] Add more case for typemismatch Zhou Wenjian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1449744091-1673-3-git-send-email-zhouwj-fnst@cn.fujitsu.com \
    --to=zhouwj-fnst@cn.fujitsu.com \
    --cc=systemtap@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).