Re: [PATCH] t5703: replace "grep -a" usage by perl
- From
Christian Couder <christian.couder@gmail.com>
- Date
- May 19, 2020, 07:13 UTC
- Message-ID
- <CAP8UFD2vYwnwgNWX3tg5w-7kCg3kzNscVbnk0DJfSD4UV-D0hg@mail.gmail.com>
- In-Reply-To
- <20200519005645.GD1999@danh.dev>
On Tue, May 19, 2020 at 3:00 AM Đoàn Trần Công Danh <congdanhqx@gmail.com> 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.
Show 10 quoted lines
> 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.