write tests to file