Capture output from tests