Re: [PATCH] t5703: replace "grep -a" usage by perl

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

 



On Tue, May 19, 2020 at 3:00 AM Đoàn Trần Công Danh
<congdanhqx@xxxxxxxxx> wrote:

> On some platforms likes HP-UX, grep(1) doesn't understand "-a".
>
> Let's switch to perl.

There are some other platforms where Perl is difficult to install.
That's why we have the 'NO_PERL' Makefile knob, and the 'PERL' test
prereq which is used in some test scripts like t0021-conversion.sh,
t2016-checkout-patch.sh, t2071-restore-patch.sh, ...

>     We can also copy-and-paste code from t4019,
>     to avoid introduce perl to this test.

This might be a good idea.

>  t/t5703-upload-pack-ref-in-want.sh | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/t/t5703-upload-pack-ref-in-want.sh b/t/t5703-upload-pack-ref-in-want.sh
> index a34460f7d8..92ad5eeec0 100755
> --- a/t/t5703-upload-pack-ref-in-want.sh
> +++ b/t/t5703-upload-pack-ref-in-want.sh
> @@ -49,15 +49,18 @@ test_expect_success 'setup repository' '
>
>  test_expect_success 'config controls ref-in-want advertisement' '

At least you should add the PERL prereq to the test with something like:

test_expect_success PERL 'config controls ref-in-want advertisement' '

>         test-tool serve-v2 --advertise-capabilities >out &&
> -       ! grep -a ref-in-want out &&
> +       perl -ne "/ref-in-want/ and print" out >out.filter &&
> +       test_must_be_empty out.filter &&

Thanks,
Christian.




[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]

  Powered by Linux