[Toybox] [PATCH] Add the gzip/gunzip/zcat tests I wrote for toolbox gzip/gunzip/zcat.

enh enh at google.com
Tue May 9 09:02:09 PDT 2017


On Wed, Apr 26, 2017 at 2:43 PM, Rob Landley <rob at landley.net> wrote:
> On 04/24/2017 03:43 PM, enh wrote:
>> Bringing the zlib-based gzip/gunzip/zcat over to toybox is a problem for
>> another day,
>
> Blah, I should take this one.
>
> I have deflate decompression side implemented already (and working at
> one point, although I just tested "make zcat" and got a bad crc
> decompressing the musl-1.1.16.gz tarball). I have the first 1/3 or so of
> compression side implemented and somewhere around here is a version
> that's about 2/3 through. I stopped at "where do dictionary resets
> happen" and basically go the answer "nobody seems to agree, just do it
> every 250k". (Which means my gzip and other gzip won't necessarily
> produce the same binary, but it should extract the same. There's
> actually a format hitch you can do sticking in gratuitous resets to
> allow parallel decompression, it's a bit like mp4 streaming mode
> sticking in extra keyframes, only noticeably cheaper. :)
>
> Adding zlib mode to that is basically the same plumbing as
> toys/*/md5sum.c does for libcrypto.
>
> Lemme try to find a chunk of time to devote to that...
>
>> but at least the tests are easy...
>>
>> (These tests pass with TEST_HOST and on the toolbox versions, but the
>> toybox toys are in pending and very broken.)
>
> The problem is this is just testing that gzip and gunzip reverse each
> other. If they share infrastructure and screw something up the same way,
> what have you proved? Also you can't test gunzip without gzip being present.

yeah, despite being the person who's trying to run the toybox tests on
a toybox-only system, i relied on testing on the host.

commit these as better than nothing and i'll follow up with a patch
adding pre-canned inputs for each of them, so each test only needs one
tool?

when i do create the pre-canned inputs, do you have any preference
about which tool (toybox/busybox/gnu) generates them?

> For bzip I added a tests/files/bzcat (and already had a lot of
> tests/files/blkid/*.bz2). I'd like to have at least a couple canned .gz
> files for reference under tests/files.
>
> I'll try to take a closer look at this later...
>
> Rob



-- 
Elliott Hughes - http://who/enh - http://jessies.org/~enh/
Android native code/tools questions? Mail me/drop by/add me as a reviewer.



More information about the Toybox mailing list