How to test 'test-helper macros'?

Hi there!

In the process of writing TypeCheck I am coming across a bit of a difficult situation:

I am creating a macro which will automatically define a couple of ExUnit tests (to be precise: ExUnitProperties property-tests) when given a module. The new macro works similarly to the doctest macro that is part of ExUnit itself.

Now I want to test whether this macro is able to correctly use the options passed to it.

The obvious approach that came to mind was to create a new testing-module which includes use ExUnit and my macro-call.

However, to test whether this works correctly, this new module needs to be called from inside a test.
But how to get this working?
Is there a way to do this ‘inside the BEAM’ or do I have to resort to maybe a technique of calling a separate mix-task on the same repository using System.cmd to execute only those particular tests?

Thank you for your help!

1 Like