I'd tend to use different files and make for testing and production builds, but if you did have a file with
int test_main (int argc, char*argv[])
and
int prod_main (int argc, char*argv[])
then the compiler options to select one or the other as the main are -Dtest_main=main
and -Dprod_main=main