My software has one main for normal use and a different one for unit tests.
I would just love it if there was an option to gcc to specify which “main” function to use.
My software has one main for normal use and a different one for unit
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Put them in separate files, and specify one .c file for normal use, and one .c file for testing.
Alternately,
#definetesting on the commandline using test builds and use something like: