Add hook for writing test results to files