Re: [PATCH 1/3] Makefile: extract script to generate clar declarations
- From
Taylor Blau <me@ttaylorr.com>
- Date
- Oct 14, 2024, 21:42 UTC
- Message-ID
- <Zw2QT/Kx6IoPhJtT@nand.local>
- In-Reply-To
- <346aa2f08307fb9c501a4b9ac3322beb44dc9d5d.1728914219.git.ps@pks.im>
On Mon, Oct 14, 2024 at 04:06:41PM +0200, Patrick Steinhardt wrote:
> Extract the script to generate function declarations for the clar unit > testing framework into a standalone script. This is done such that we > can reuse it in other build systems.
Makes sense.
> +while test "$#" -ne 0 > +do > + suite="$1" > + shift
I'm perhaps nit-picking here, but I find:
for suite in "$@"
do
...
doneto be much more readable than 'while test "$#" -ne 0' and 'shift' above, since the for-loop variant does not need to mangle its arguments with shift.
> + sed -ne "s/^\(void test_$suite__[a-zA-Z_0-9][a-zA-Z_0-9]*(void)$\)/extern \1;/p" "$suite" ||
This part is a faithful translation of the original Makefile. Looking good.
Thanks, Taylor