chiark / gitweb /
autopkgtests: wip, an actual very simple test
[userv.git] / tests / lib
diff --git a/tests/lib b/tests/lib
new file mode 100644 (file)
index 0000000..ae2aa50
--- /dev/null
+++ b/tests/lib
@@ -0,0 +1,12 @@
+# -*- shell-script -*-
+
+expect_output () {
+    local e_status=$1; shift
+    local e_stdout=$1; shift
+    set +e
+    local g_stdout="$( "$@" )"
+    local g_status=$?
+    set -e
+    test "$g_status" = "$e_status"
+    test "$g_stdout" = "$e_stdout"
+}