Subject: bug#66782: 29.1; ERT tests report test redefined depending on loading sequence

From: Mattias Engdegård <[email-masked]>
Date: Thu, 2 Nov 2023 19:56:41 +0100

2 nov. 2023 kl. 18.17 skrev Xiyue Deng <[email-masked]>:

>> I understand if upstream don't want to complicate `require' logic too
>> much.  However I wonder whether it's OK to add warning if a required
>> module has `ert-deftest' in it, so that it can help people identify that
>> a `Test "foo" redefined' error is due to requiring other module instead
>> of an actual duplicated test name.  How does this sound?
> 
> As I didn't get an answer I assume this was a no-go.

No, please don't make such an assumption -- I was just busy elsewhere and hadn't given your message the attention it deserved. Sorry about that.

That said, in this case I'm not sure how to implement your suggestion in a clean way and if all that effort is really worth the trouble, so perhaps the answer would be the same anyway. And we probably don't want to prohibit `ert-deftest` in  required modules in general for reasons mentioned -- they could be used with perfectly fine discipline elsewhere.

>  So instead I'd
> like to propose a slight change to the error message to mention that it
> may also be caused by an ert test being loaded multiple times.  Patch is
> attached, please let me know whether this works.

I wouldn't mind such a change if it really would help. Would it? Isn't it just restating the problem in other words?