Add writing of test results to files