aboutsummaryrefslogtreecommitdiff
path: root/t/test_testlib.sh
diff options
context:
space:
mode:
authorMattia Rizzolo <mattia@mapreri.org>2015-10-13 10:26:06 +0000
committerMattia Rizzolo <mattia@mapreri.org>2015-10-13 10:26:06 +0000
commit72075b8430b826d7dd489765c1004e4161479fa2 (patch)
tree682a8d69bcc478082f1805859eb72445e8b6cf42 /t/test_testlib.sh
parent524cde2e544f40dc2056d2a4c4265ddc4160784d (diff)
downloadpbuilder-72075b8430b826d7dd489765c1004e4161479fa2.tar
pbuilder-72075b8430b826d7dd489765c1004e4161479fa2.tar.gz
move all tests under a t/ directory
Diffstat (limited to 't/test_testlib.sh')
-rwxr-xr-xt/test_testlib.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/t/test_testlib.sh b/t/test_testlib.sh
new file mode 100755
index 0000000..a37f6b1
--- /dev/null
+++ b/t/test_testlib.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+# testsuite for testlib
+
+TD="$(dirname "$0")"
+if [ -n "$PBUILDER_CHECKOUT" ]; then
+ . "$TD/testlib.sh"
+ . "$PBUILDER_CHECKOUT/pbuilder-modules"
+else
+ . "$TD/testlib.sh"
+ . "$PBUILDER_TEST_PKGLIBDIR/pbuilder-modules"
+fi
+
+test_success() {
+ exit 0
+}
+
+test_fail() {
+ exit 1
+}
+
+test_options() {
+ echo "$@"
+ exit 1
+}
+
+test_output() {
+ echo "$@"
+}
+
+expect_success test_success
+expect_fail test_fail
+expect_fail test_options "hello world"
+expect_output "foo bar" test_output "foo" "bar"
+testlib_summary