Thomas, I have made a function called register_test/3 public, this means you should be able to mimic the test/3 implementation in your code:
defmacro property(message, var \\ quote(do: _), contents) do
contents =
case contents do
[do: block] ->
quote do
unquote(block)
:ok
end
_ ->
quote do
try(unquote(contents))
:ok
end
end
var = Macro.escape(var)
contents = Macro.escape(contents, unquote: true)
quote bind_quoted: binding do
property = :"property #{message}"
ExUnit.Case.register_test(__ENV__, test, [[type: :property]])
def unquote(property)(unquote(var)), do: unquote(contents)
end
end
All of the functions in the code sample above are public API, so you can rely on them. :) I will look into implementing a sub-counter for the properties. That will probably be possible if we implement a counter for assertions. So we would see:
11 tests (25 assertions)
And in your case:
11 properties (431 tests)