autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: verbose testsuite output contains 1M newlines


From: Eric Blake
Subject: Re: verbose testsuite output contains 1M newlines
Date: Wed, 15 Apr 2009 06:47:26 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.21) Gecko/20090302 Thunderbird/2.0.0.21 Mnenhy/0.7.6.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Eric Blake on 4/14/2009 7:17 PM:
> According to Ralf Wildenhues on 4/14/2009 1:26 PM:
>> Almost.  It seems inconsistent that only ignore-nolog allows non-text
>> output.  What about ensuring that std{out,err}-nolog do likewise, by
>> sending some large lines to all three in a test?
> 
> Or even files that lack a trailing newline, or contain non-printing
> characters (or all three).  I'm working up a test, and will post it, along
> with the other patches, as a series when I'm complete.

Here's what I added to the series before pushing.  I don't really know how
to parse that diff gave reasonable output, as $at_diff may or may not be
using -u, and may print 'binary files differ' instead of comparing
contents (not to mention that grep and sed are not required to handle
binary files).  But by testing that valid binary tests compare equal, and
slightly modified binary tests compare different, I think I've covered the
intent that we want autotest to handle non-text files.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAknl110ACgkQ84KuGfSFAYAXhACgnaLxBOs0xnkiqupw54q57awe
ZPsAn15ZbxfFUIqLkk14o68c0bL+213w
=hEnX
-----END PGP SIGNATURE-----
>From 7ece247bdd194997f5a79aeaad3e7b02bc7130e2 Mon Sep 17 00:00:00 2001
From: Eric Blake <address@hidden>
Date: Wed, 15 Apr 2009 06:38:58 -0600
Subject: [PATCH] Test that autotest handles binary output.

* tests/autotest.at (Binary output): New test.
Suggested by Ralf Wildenhues.

Signed-off-by: Eric Blake <address@hidden>
---
 ChangeLog         |    4 ++++
 tests/autotest.at |   42 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 46 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b33ba8d..b7dd8f6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2009-04-15  Eric Blake  <address@hidden>

+       Test that autotest handles binary output.
+       * tests/autotest.at (Binary output): New test.
+       Suggested by Ralf Wildenhues.
+
        Add stdout-nolog and ignore-nolog to AT_CHECK.
        * lib/autotest/general.m4 (AT_DIFF_STDERR(stderr-nolog))
        (AT_DIFF_STDERR(ignore-nolog), AT_DIFF_STDOUT(stdout-nolog))
diff --git a/tests/autotest.at b/tests/autotest.at
index ed898cd..721925c 100644
--- a/tests/autotest.at
+++ b/tests/autotest.at
@@ -332,6 +332,48 @@ magicstring06
 ]])])


+AT_CHECK_AT([Binary output],
+  [[AT_INIT([artificial test suite])
+    AT_SETUP([pass: no trailing newline])
+    AT_CHECK([printf short], [0], [stdout-nolog])
+    AT_CHECK([cat stdout], [0], [[short]])
+    AT_CLEANUP
+    AT_SETUP([pass: non-printing characters])
+    AT_CHECK([printf '\1\n' >&2], [0], [], [stderr-nolog])
+    printf '\1\n' > expout
+    AT_CHECK([cat stderr], [0], [expout])
+    AT_CLEANUP
+    AT_SETUP([pass: long lines])
+    # 5000 bytes in str
+    str=..........
+    str=$str$str$str$str$str$str$str$str$str$str
+    str=$str$str$str$str$str$str$str$str$str$str
+    str=$str$str$str$str$str
+    AT_CHECK_NOESCAPE([echo $str], [0], [[$str]m4_newline])
+    AT_CLEANUP
+    AT_SETUP([fail: no trailing newline])
+    AT_CHECK([printf short], [0], [stdout-nolog])
+    AT_CHECK([cat stdout], [0], [[long]])
+    AT_CLEANUP
+    AT_SETUP([fail: non-printing characters])
+    AT_CHECK([printf '\1\n' >&2], [0], [], [stderr-nolog])
+    printf '\2\n' > expout
+    AT_CHECK([cat stderr], [0], [expout])
+    AT_CLEANUP
+    AT_SETUP([fail: long lines])
+    # 5000 bytes in str
+    str=..........
+    str=$str$str$str$str$str$str$str$str$str$str
+    str=$str$str$str$str$str$str$str$str$str$str
+    str=$str$str$str$str$str
+    AT_CHECK_NOESCAPE([echo x$str], [0], [[${str}x]m4_newline])
+    AT_CLEANUP
+]], [], [0], [], [], [],
+  [AT_CHECK([$CONFIG_SHELL ./micro-suite 4], [1], [ignore], [ignore])
+   AT_CHECK([$CONFIG_SHELL ./micro-suite 5], [1], [ignore], [ignore])
+   AT_CHECK([$CONFIG_SHELL ./micro-suite 6], [1], [ignore], [ignore])], [1-3])
+
+
 AT_CHECK_AT_TEST([Cleanup],
   [AT_CHECK([test ! -f cleanup.success && test ! -f cleanup.failure])
    AT_CHECK_NOESCAPE([exit $value], [ignore], [$output],
-- 
1.6.1.2


reply via email to

[Prev in Thread] Current Thread [Next in Thread]