summaryrefslogtreecommitdiffstats
path: root/testsuite/pwdx.test
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/pwdx.test')
-rw-r--r--testsuite/pwdx.test/pwdx.exp22
1 files changed, 22 insertions, 0 deletions
diff --git a/testsuite/pwdx.test/pwdx.exp b/testsuite/pwdx.test/pwdx.exp
new file mode 100644
index 0000000..2f71cbd
--- /dev/null
+++ b/testsuite/pwdx.test/pwdx.exp
@@ -0,0 +1,22 @@
+
+make_testproc
+
+set pwdx "${topdir}src/pwdx"
+# Run pwdx with no arguments
+set test "pwdx no args"
+spawn $pwdx
+expect_pass "$test" "^\\s*Usage:\\s+\(lt-\)\?pwdx \\\[options\\\] pid\.\.\."
+
+# Run pwdx with pid 0 which is invalid
+set test "pwdx pid 0 should be invalid"
+spawn $pwdx 0
+expect_pass "$test" "\(lt-\)\?pwdx\: invalid process id\: 0"
+
+# Run pwdx with existing pid
+set test "pwdx find test process cwd"
+set my_pwd [ pwd ]
+spawn $pwdx $testproc1_pid
+expect_pass "$test" "^$testproc1_pid: $my_pwd"
+
+# Cleanup
+kill_testproc