]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
3145. [test] Capture output of ATF unit tests in "./atf.out" if
authorEvan Hunt <each@isc.org>
Tue, 23 Aug 2011 01:29:39 +0000 (01:29 +0000)
committerEvan Hunt <each@isc.org>
Tue, 23 Aug 2011 01:29:39 +0000 (01:29 +0000)
there were any errors while running them. [RT #25527]

CHANGES
lib/dns/tests/.cvsignore
lib/dns/tests/Makefile.in
lib/dns/tests/update_test.c
lib/isc/tests/.cvsignore
lib/isc/tests/Makefile.in
unit/unittest.sh.in

diff --git a/CHANGES b/CHANGES
index 410d88c0a0d489c7a481a8853992d1ba0cd00a06..c627bd6f76d1c97db5eb5c4df56e4c10a1646964 100644 (file)
--- 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]
 
index ee50e13466c2d77ae07763a70e9fd54023db0958..6abab36d4a4a184988ef45546f1f059873d0e8ab 100644 (file)
@@ -1,2 +1,3 @@
 Makefile
+atf.out
 *_test
index 5a8dd7040e95f488340f3074734199bf3abe8589..b8bd9dc12880fb5f17b23471a46045fc96daabdb 100644 (file)
@@ -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.6 2011/08/23 00:59:23 each Exp $
+# $Id: Makefile.in,v 1.7 2011/08/23 01:29:38 each Exp $
 
 srcdir =       @srcdir@
 VPATH =                @srcdir@
@@ -76,3 +76,4 @@ unit::
 
 clean distclean::
        rm -f ${TARGETS}
+       rm -f atf.out
index 07c2aa96876ea2a282fedef8563e9f31cf8591cb..934a4696b22b4f8d4e54a66cc8bdaa9509bd2042 100644 (file)
@@ -14,7 +14,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: update_test.c,v 1.4 2011/07/06 18:11:35 each Exp $ */
+/* $Id: update_test.c,v 1.5 2011/08/23 01:29:38 each Exp $ */
 
 /* $Id: */
 
@@ -69,7 +69,7 @@ ATF_TC_BODY(increment, tc) {
        ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
        new = dns_update_soaserial(old, dns_updatemethod_increment);
        ATF_REQUIRE_EQ(isc_serial_lt(old, new), ISC_TRUE);
-       ATF_CHECK(new != 0);
+       ATF_CHECK_MSG(new != 0, "new (%d) should not equal 0", new);
        ATF_REQUIRE_EQ(new, 51);
        dns_test_end();
 }
index ee50e13466c2d77ae07763a70e9fd54023db0958..6abab36d4a4a184988ef45546f1f059873d0e8ab 100644 (file)
@@ -1,2 +1,3 @@
 Makefile
+atf.out
 *_test
index abe8cf82c909cb414a13b98c3e530bff70a95eb2..88fb55a02ef8718c7501d7045643bfb10d302cb2 100644 (file)
@@ -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.5 2011/08/23 00:59:23 each Exp $
+# $Id: Makefile.in,v 1.6 2011/08/23 01:29:38 each Exp $
 
 srcdir =       @srcdir@
 VPATH =                @srcdir@
@@ -59,3 +59,4 @@ unit::
 
 clean distclean::
        rm -f ${TARGETS}
+       rm -f atf.out
index 8dd989719319fceef2d49c37953528d363aabeda..2b4f4b5b611cb7d4ce28c67c1e63bfabccf1b0e4 100644 (file)
@@ -5,6 +5,8 @@ export PATH
 
 if [ -n "@ATFBIN@" ]
 then
-        # | cat is there to force non-fancy output
-       atf-run | atf-report | cat
+       atf-run > atf.out
+        status=$?
+        atf-report < atf.out
+        [ $status -eq 0 ] && rm -f atf.out
 fi