Subject: Re: [PATCH net 0/2] selftests: net: add missing tests to Makefile

From: Hangbin Liu <[email-masked]>
Date: Thu, 19 May 2022 11:13:23 +0800

On Wed, May 18, 2022 at 08:25:48AM -0700, Jakub Kicinski wrote:
> On Wed, 18 May 2022 14:01:43 +0800 Hangbin Liu wrote:
> > > > +files=$(git show --name-status --oneline | grep -P '^A\ttools/testing/selftests/net/' | grep '\.sh$' | sed 's@A\ttools/testing/selftests/net/@@')
> 
> FWIW this will list just the names of bash scripts with no decoration:
> 
>   git show --pretty="" --name-only -- tools/testing/selftests/*.sh
> 
> And we can get the names of the files with basename:
> 
>   for f in $(git show --pretty="" --name-only); do basename $f; done

This way is easier :)

> > python for testing. So I think there is no need to check all
> > tools/testing/selftests/.*/Makefile. WDYT?
> 
> Not sure I understand, let me explain what I meant in more detail. 
> I think we should make it generic. For example check the Makefile 
> in the same location as the script:
> 
>   grep $(basename $f) $(dirname $f)/Makefile
> 
> And maybe just to be safe one directory level down?
> 
>   grep $(basename $f) $(dirname $(dirname $f))/Makefile
> 
> Instead of hardcoding the expected paths.

Ah, got what you mean. Thanks. I will check how to update the script
and open PR after that.

Cheers
Hangbin