[Dctrl-tools-devel] [SCM] Debian control file query tools branch, master, updated. 2.14-25-g808de4e
Antti-Juhani Kaijanaho
ajk at debian.org
Sat Aug 28 17:23:30 UTC 2010
The following commit has been merged in the master branch:
commit 710b0a4e092611343e008653d7f9dc2a35592e00
Author: Antti-Juhani Kaijanaho <ajk at debian.org>
Date: Sat Aug 28 11:48:39 2010 +0300
tester.sh: Support stderr verification
Signed-off-by: Antti-Juhani Kaijanaho <ajk at debian.org>
diff --git a/tester.sh b/tester.sh
index 0debf24..55d0b6a 100644
--- a/tester.sh
+++ b/tester.sh
@@ -1,6 +1,6 @@
#!/bin/sh
# dctrl-tools - Debian control file inspection tools
-# Copyright (C) 2007 Antti-Juhani Kaijanaho
+# Copyright (C) 2007, 2010 Antti-Juhani Kaijanaho
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -18,13 +18,13 @@
set -e
-trap "rm .testout .diffout 2>/dev/null" \
+trap "rm .testout .diffout .testerr .differr 2>/dev/null" \
EXIT ABRT BUS FPE HUP ILL QUIT SEGV TERM
-GREP_DCTRL=$PWD/grep-dctrl/grep-dctrl
-SORT_DCTRL=$PWD/sort-dctrl/sort-dctrl
-TBL_DCTRL=$PWD/tbl-dctrl/tbl-dctrl
-JOIN_DCTRL=$PWD/join-dctrl/join-dctrl
+GREP_DCTRL=../grep-dctrl/grep-dctrl
+SORT_DCTRL=../sort-dctrl/sort-dctrl
+TBL_DCTRL=../tbl-dctrl/tbl-dctrl
+JOIN_DCTRL=../join-dctrl/join-dctrl
export GREP_DCTRL SORT_DCTRL TBL_DCTRL JOIN_DCTRL
cd tests
@@ -41,6 +41,7 @@ for tst in $tests ; do
tst_base=`basename $tst .sh`
tst_in=$tst_base.in
tst_out=$tst_base.out
+ tst_ero=$tst_base.err
tst_err=$tst_base.fails
if [ ! -r $tst_in ] ; then
tst_in=/dev/null
@@ -54,22 +55,37 @@ for tst in $tests ; do
else
echo -n "$0: Test case $tst_base (expecting success)..."
fi
- if sh $tst < $tst_in > .testout ; then
+ ok=true
+ if sh $tst < $tst_in > .testout 2> .testerr ; then
if diff -au $tst_out .testout > .diffout ; then
- echo "ok."
+ :
else
- echo "FAILED."
- cat .diffout
- rv=1
+ ok=false
fi
else
if [ -r $tst_err ] ; then
- echo "ok."
+ :
else
- echo "FAILED."
- rv=1
+ ok=false
fi
fi
+ if [ -r $tst_ero ] ; then
+ if diff -au $tst_ero .testerr > .differr ; then
+ :
+ else
+ ok=false
+ fi
+ fi
+ if $ok ; then
+ echo "ok."
+ else
+ echo "FAILED."
+ echo "stdout diff:"
+ cat .diffout
+ echo "stderr diff:"
+ cat .differr
+ rv=1
+ fi
done
exit $rv
--
Debian control file query tools
More information about the Dctrl-tools-devel
mailing list