Re: [PATCH v5 3/4] test-strcmp-offset: created test for strcmp_offset

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

 



Hi Gábor,

On Thu, 6 Apr 2017, SZEDER Gábor wrote:

> I think this patch should be squashed into the previous commit;  I
> don't see any reason why the tests should be added in a different
> commit than the function they are testing.

I am of two minds there. In some cases, the newly added test demonstrates
the intended usage, and therefore makes for a nice documentation. In other
cases, the new test is large enough to stand on its own, i.e. to merit a
separate patch (also to make reviewing easier).

In this particular case, I tend to the latter: it is large enough a patch
that it is easier to review as a separate patch.

> >  t/helper/test-strcmp-offset.c | 64 +++++++++++++++++++++++++++++++++++++++++++
> >  t/t0065-strcmp-offset.sh      | 11 ++++++++
> >  4 files changed, 77 insertions(+)
> >  create mode 100644 t/helper/test-strcmp-offset.c
> >  create mode 100755 t/t0065-strcmp-offset.sh
> 
> Sure, tests are good, but I have to wonder how this would scale in the
> long term, when even such simple functions would get their own
> t/helper/test-func executable and t/tNNNN-func.sh script.

True. The proliferation of executables in t/helper/ got a little out of
hand.

But there is nothing preventing us from consolidating a few of them into a
single executable, using our wonderful option parsing function with
OPT_CMDMODE to switch between the different functions.

I could see, for example, how we could consolidate all string-related
test helpers into a single one, say, test-strings:

t/helper/test-ctype.c
t/helper/test-regex.c
t/helper/test-strcmp-offset.c
t/helper/test-string-list.c
t/helper/test-line-buffer.c
t/helper/test-urlmatch-normalization.c
t/helper/test-wildmatch.c

Also, these helpers seem to be related to index handling and could go into
a new test-index helper:

t/helper/test-dump-cache-tree.c
t/helper/test-dump-split-index.c
t/helper/test-dump-untracked-cache.c
t/helper/test-index-version.c
t/helper/test-scrap-cache-tree.c

Ciao,
Johannes

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]