tau
tau copied to clipboard
docs: TEST blocks require that there is no return value
From a little toy project https://github.com/matu3ba/pbcd/blob/4ffd0dfe6006c5342302d4099c02d537facf4ffe/runTest.sh
^
test.c:28:3: error: void function '_TAU_TEST_FUNC_foo_bar1' should not return a value [-Wreturn-type]
return status;
Alternatively (but probably more cumbersome): support custom return values.
Why would you want to return anything within a testing block?
Why would you want to return anything within a testing block?
To copy paste main and not being forced to wrap the to be tested method within another method ie for return codes (say one wants to simulate allocation failures or other stuff). This is probably more of an edge case, so I phrased the issue as "docs".
I agree it's more of an edge case, so unless there's significant user traction for this feature, I'll defer this for a later stage.