Implement prepare_test.