On 4 April 2018 at 10:59, Tom de Vries <tom_devr...@mentor.com> wrote:
> On 04/03/2018 07:49 PM, Bernhard Reutner-Fischer wrote:
>>>
>>> This patch adds scan-ltrans-tree-dump.
>>
>>
>> Please check all error calls to talk about the correct function -- at
>> least scan-ltrans-tree-dump-times is wrong.
>>
>
> Hi,
>
> thanks for noticing that. I'll update the patches to fix that.
>
> But I wonder if it's not a better idea to get the function name using "info
> level", and to move the code that checks the number of arguments into a
> utility function, as done in the demonstrator patch below.

Right, good idea, that's even better IMHO.
As to where to load it, there are each */testsuite/config/default.exp
where you could load_lib something like a gcc/testsuite/lib/utils.exp

Oh, and there seem to be a min == max category of errors that want
e.g.  check_num_args 2 2 and in the min == max case want to emit
gcc/testsuite/lib/gcc-dg.exp:   error "dg-set-target-env-var: need two
arguments"
gcc/testsuite/lib/gcc-dg.exp:   error "dg-set-compiler-env-var: need
two arguments"

where i'd use the number of course.
Just a thought, though.

>
> Rainer, Mike, any comments? I can write a patch that uses check_num_args in
> testsuite/lib/*.exp (though I'm not yet sure where to move it such that it
> can be used everywhere).
>
> Thanks,
> - Tom

Reply via email to