Re: [PATCH] gnulib-tool.py: Fix --extract-recursive-link-directive.

2024-03-21 Thread Collin Funk
Hi Bruno,

On 3/21/24 9:00 AM, Bruno Haible wrote:
> Thanks. So, we are still finding logic bugs... Which proves that the
> test suite is necessary. I don't think we would have found this typo
> by mere code review (within a finite time).

Yes, agreed. The info-tests/* are very quick so it is easy to check
changes like this. If I remember correctly, when implementing
--extract-recursive-link-directive, I couldn't think of any good test
cases.

> Thanks. Applied, except for the change to link_sections.

Yes that makes more sense now that I look at gnulib-tool.sh.

Collin



Re: [PATCH] gnulib-tool.py: Fix --extract-recursive-link-directive.

2024-03-21 Thread Bruno Haible
Hi Collin,

> This patch fixes the failure of
> 'test-extract-recursive-link-directive-3.sh' in the gnulib-tool test
> suite:
> 
> cmp: EOF on tmp529181-out which is empty
> --- ./test-extract-recursive-link-directive-3.output  2024-03-20 
> 19:16:08.842291576 -0700
> +++ tmp529181-out 2024-03-20 19:17:56.295403277 -0700
> @@ -1,2 +0,0 @@
> -$(MBRTOWC_LIB)
> -$(SETLOCALE_LIB)
> FAIL: gnulib-tool's output has unexpected differences.
> FAIL: test-extract-recursive-link-directive-3.sh
> 
> Due to this typo
> 
>  for module in inmodules_this_round:
> -if self.getLink() != '':
> +if module.getLink() != '':
> 
> the only 'Link:' section checked is from the original module.

Thanks. So, we are still finding logic bugs... Which proves that the
test suite is necessary. I don't think we would have found this typo
by mere code review (within a finite time).

> Since we want to remove duplicate link directives, I have also changed
> the lists to sets.

Thanks. Applied, except for the change to link_sections. We need to remove
duplicates only at the end, among the lines. It is simpler to not remove
duplicates in link_sections, both conceptually as well as (probably)
computationally.

Bruno