-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Defining testsets inside a function not supported? #44
Comments
Chances are you've seen it, but just in case not, this section of the documentation discusses this issue and provides a mechanism that might do the trick :). |
Yeah it's an open problem for ReTest. In a branch I've tried improving the API around In any case, a solution would probably involve annotating the function containing |
I imagine you've thought of something like iterating calls to runtests till a fixed point is reached Rafael, and discarded the idea? :) |
That's a good idea to explore more, but basically the problem is that there might be legitimate use cases where you want to have a function define toplevel testsets. In the OP example, that's not the case, and you want the newly defined testset to be a child of the currently running testset. This pattern works with And BTW, the issue is very simliar to using For include, a specific For functions, the current workaround is to use macros. The slightly better API, mentioned in my previous comment above, that I tried to implement was something like In any case, I need to dive again into this problem :) Last time I gave up after one non-conclusive day of work, to focus on more urgent features. |
Cheers, thanks for the thoughtful response Rafael! :) |
For OSCAR, we use "testset templates" to provide generic conformance for various "interfaces" based on
Test
.These currently come in the form of a function that takes an object to be tested, and which then internally produces a
@testset
carrying out the test. The idea is that other packages then can use these conformance tests on their own implementations of those interfaces/protocols.Here is a severely stripped down example:
Unfortunately, with
ReTest
, this doesn't seem to be supported? Trying to useReTest
with the above resulted in this:I.e. it isn't capturing the surrounding context.
Is there any chance this could be fixed? If so, how complicated do you think it would be / where would one have to start?
I am also open to alternative suggestions for implementing such conformance tests; but the current approach is quite nice in that it is easy to grok what it does.
The text was updated successfully, but these errors were encountered: