I would like to write unit tests which log what they are doing. This per-test log output should only be shown in the case where the test fails, not when it passes.
I have looked at whether ounit2 and alcotest would provide this feature. OUnit2 has a logf function that is completely undocumented, and does not seem to do this. Alcotest has a verbose option that sends the stdout/stderr output of tests either to the terminal or to log files, but it does not mention having different output when the test fails.
Would you know of how to do this in an existing unit-test framework?