Move test runner logic to a separate file