[PATCH] Selftest improvements

Jamie McClymont jamiemcclymont at catalyst.net.nz
Tue Feb 13 02:53:07 UTC 2018

Hi Jim,

On 09/02/18 04:18, jim via samba-technical wrote:
>> On 08/02/18 16:17, jim via samba-technical wrote:
> You should add explicit run-time checks in each function to verify it
> was called with the expected number of arguments

I honestly think this is an unnecessary deviation from standard perl
practices -- all of these setup_* functions are called from just a
single line, which dynamically calls them in a consistent way. This way
is clearly documented in a short comment where somebody adding a new env
would almost certainly read it (above each ENV_DEPS declaration).

The other function in question, skip, is now being passed the array
representing a testsuite -- currently it only considers the first two
arguments (name and env), but it could reasonably want to look at more
in future. Conversely, things could be added to that array without it
affecting skip.

More broadly: this would be a very unusual practice in the perl world,
judging by the reactions of my colleagues who are write perl full time
when I brought this up.

- Jamie

More information about the samba-technical mailing list