From 4efd18941dfae9f8ade04b9a0a5a02c2636a298f Mon Sep 17 00:00:00 2001 From: Evan Hunt Date: Tue, 23 Aug 2011 01:28:42 +0000 Subject: [PATCH] 3145. [test] Capture output of ATF unit tests in "./atf.out" if there were any errors while running them. [RT #25527] --- CHANGES | 3 +++ lib/dns/tests/.cvsignore | 1 + lib/dns/tests/Makefile.in | 3 ++- unit/unittest.sh.in | 10 ++++++++-- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 5c9d315ed4..5c6a9de4fd 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +3145. [test] Capture output of ATF unit tests in "./atf.out" if + there were any errors while running them. [RT #25527] + 3144. [bug] dns_dbiterator_seek() could trigger an assert when used with a nonexistent database node. [RT #25358] diff --git a/lib/dns/tests/.cvsignore b/lib/dns/tests/.cvsignore index a1ce2db25a..78dc57c3d2 100644 --- a/lib/dns/tests/.cvsignore +++ b/lib/dns/tests/.cvsignore @@ -1,3 +1,4 @@ Makefile +atf.out master_test ncache_test diff --git a/lib/dns/tests/Makefile.in b/lib/dns/tests/Makefile.in index 79b6912563..900653a144 100644 --- a/lib/dns/tests/Makefile.in +++ b/lib/dns/tests/Makefile.in @@ -12,7 +12,7 @@ # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR # PERFORMANCE OF THIS SOFTWARE. -# $Id: Makefile.in,v 1.2.6.4 2011/08/23 00:57:11 each Exp $ +# $Id: Makefile.in,v 1.2.6.5 2011/08/23 01:28:41 each Exp $ srcdir = @srcdir@ VPATH = @srcdir@ @@ -63,3 +63,4 @@ unit:: clean distclean:: rm -f ${TARGETS} + rm -f atf.out diff --git a/unit/unittest.sh.in b/unit/unittest.sh.in index 904f5b1663..73df4b009a 100644 --- a/unit/unittest.sh.in +++ b/unit/unittest.sh.in @@ -14,12 +14,18 @@ # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR # PERFORMANCE OF THIS SOFTWARE. -# $Id: unittest.sh.in,v 1.2.6.6 2011/03/03 11:24:43 marka Exp $ +# $Id: unittest.sh.in,v 1.2.6.7 2011/08/23 01:28:42 each Exp $ PATH=${PATH}:@ATFBIN@ export PATH if [ -n "@ATFBIN@" ] then - atf-run | atf-report -o csv:- | cat + atf-run > atf.out + status=$? + + # | cat is there to force non-fancy output + atf-report < atf.out | cat + + [ $status -eq 0 ] && rm -f atf.out fi