aboutsummaryrefslogtreecommitdiff
path: root/testlib.sh
diff options
context:
space:
mode:
authorJunichi Uekawa <dancer@netfort.gr.jp>2008-08-12 04:16:17 +0900
committerJunichi Uekawa <dancer@netfort.gr.jp>2008-08-12 04:16:17 +0900
commit48de02113c3cea946598fe6be71cdcd0722793b7 (patch)
treea74f5164a1a7d4d2aa552a9a1b6629173ed5e4c3 /testlib.sh
parentb1399cc2e69ac704f836c5199c0c781458f0c353 (diff)
downloadpbuilder-48de02113c3cea946598fe6be71cdcd0722793b7.tar
pbuilder-48de02113c3cea946598fe6be71cdcd0722793b7.tar.gz
added test things to --echo as well.
Diffstat (limited to 'testlib.sh')
-rw-r--r--testlib.sh10
1 files changed, 5 insertions, 5 deletions
diff --git a/testlib.sh b/testlib.sh
index 533fd94..e65b257 100644
--- a/testlib.sh
+++ b/testlib.sh
@@ -58,13 +58,13 @@ expect_fail() {
expect_output() {
# run the test in subshell
- local val
- val="$1";
- shift
- if [ $( "$@" ) = "$1" ]; then
+ local val result
+ val="$1"; shift
+ result="$( ( "$@" 2>&1 ) )"|| true
+ if [ "${result}" = "${val}" ]; then
testlib_echo "OK" "$1"
else
- testlib_echo "FAIL" "$1"
+ testlib_echo "FAIL" "$1 reason: [${result}] != [${val}]"
fi
}