+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" }
+ }
}
--- /dev/null
+#
+# 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+"
+