When building a test runner, don't remove the main function

fix issue #4488