Re: [PATCH] test-lint-duplicates: Only check for numbered test cases
- From
Jeff King <peff@peff.net>
- Date
- Apr 10, 2013, 16:00 UTC
- Message-ID
- <20130410160037.GB10749@sigill.intra.peff.net>
- In-Reply-To
- <516573CA.2000804@web.de>
On Wed, Apr 10, 2013 at 04:14:34PM +0200, Torsten Bögershausen wrote:
Show 13 quoted lines
> > test-lint-duplicates:
> > - @dups=`echo $(T) | tr ' ' '\n' | sed 's/-.*//' | sort | uniq -d` && \
> > + @dups=`echo $(T) | tr ' ' '\n' | \
> > + sed -e 's,.*/,,' -e 's/\(t[0-9][0-9][0-9][0-9]\)-.*/\1/' | \
> > + sort | uniq -d` && \
> > test -z "$$dups" || { \
> > echo >&2 "duplicate test numbers:" $$dups; exit 1; }
> >
> >
> > -Peff
> I thinkg we need both the striping of the path and the "grepping" for
> numbered test cases only.
> I'll send a patch in a minuteI think it is fine either way. My command above turns:
/path/to/test-one.sh /path/to/test-two.sh
into
test-one.sh test-two.sh
which is fine for running through uniq. If you use "sed -n", you simply end up with an empty list, which is also fine.
-Peff