]> granicus.if.org Git - procps-ng/commitdiff
new free commands
authorCraig Small <csmall@enc.com.au>
Wed, 23 Nov 2011 11:48:49 +0000 (22:48 +1100)
committerCraig Small <csmall@enc.com.au>
Wed, 23 Nov 2011 11:48:49 +0000 (22:48 +1100)
testsuite/.gitignore
testsuite/Makefile.am
testsuite/config/unix.exp
testsuite/global-conf.exp [new file with mode: 0644]
testsuite/procps-ng.test/free.test/free.exp [new file with mode: 0644]
testsuite/procps-ng.test/pwdx.test/pwdx.exp [moved from testsuite/pwdx.test/pwdx.exp with 96% similarity]

index 1e6f9352d05dd13f45433f22e2903065b647b596..96ef0306bf76213216bb105b6916aef59d69a425 100644 (file)
@@ -1,2 +1,4 @@
 *.log
 *.sum
+site.bak
+site.exp
index dc57c450698affd54d8c3e93c235494acb171b5e..e0f2bc00b4e1146874d33544a6526d73ab457e5c 100644 (file)
@@ -2,4 +2,4 @@ AUTOMAKE_OPTIONS = dejagnu
 export DEJAGNU
 
 DEJATOOL = \
-       pwdx
+       procps-ng 
index d329d7ec6e45c591fe7cca8e2870b8cfb0d897c3..c0dac44756728ede21b56395531cc11ee9683fd8 100644 (file)
@@ -1,8 +1,39 @@
 
+regexp "(.*\/)testsuite" $objdir objdir topdir
+
 proc pwdx_load { arg } { }
 proc pwdx_exit {} {}
 proc pwdx_version {} {
+  global topdir
   set tmp [ exec pwdx -V ]
   regexp "procps-ng version (\[0-9.\]*)" $tmp tmp version
-  clone_output "pwdx version $version\n"
+  clone_output "${topdir}pwdx version $version\n"
+}
+
+# free functions
+proc free_load { arg } { }
+proc free_exit {} {}
+proc free_version {} {
+  set tmp [ exec free --version ]
+  regexp "procps-ng version (\[0-9.\]*)" $tmp tmp version
+  clone_output "free version $version\n"
+}
+
+#
+#
+# common utilities
+proc expect_continue { testname reg } {
+    expect {
+        -re "$reg" { }
+        eof { fail "$testname" }
+        timeout { fail "$testname" }
+    }
+}
+
+proc expect_pass { testname reg } {
+    expect {
+        -re "$reg" { pass "$testname" }
+        eof { fail "$testname" }
+        timeout { fail "$testname" }
+    }
 }
diff --git a/testsuite/global-conf.exp b/testsuite/global-conf.exp
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/testsuite/procps-ng.test/free.test/free.exp b/testsuite/procps-ng.test/free.test/free.exp
new file mode 100644 (file)
index 0000000..a5f251f
--- /dev/null
@@ -0,0 +1,9 @@
+#
+# Testsuite for free program
+#
+
+set free "${topdir}free"
+set test "free with no arguments"
+spawn free
+expect_pass "$test" "^\\s+total\\s+used\\s+free\\s+shared\\s+buffers\\s+cached\\s*Mem:\\s+\\d+\\s+\\d+\\s+\\d+\\s+\\d+\\s+\\d+\\s+\\d+\\s*-\\/\\+ buffers\\/cache:\\s+\\d+\\s+\\d+\\s*Swap:\\s+\\d+\\s+\\d+\\s+\\d+"
+
similarity index 96%
rename from testsuite/pwdx.test/pwdx.exp
rename to testsuite/procps-ng.test/pwdx.test/pwdx.exp
index cd60c211b79e03f3de0e578e2be4c8a788e819fe..7f830372fd3365ec53710c85c29a7aed8cee833a 100644 (file)
@@ -1,4 +1,5 @@
 
+set pwdx "${topdir}pwdx"
 # Run pwdx with no arguments
 set test "pwdx no args"
 spawn pwdx