I'd like to include a testing
I don't see a better solution than
-DINCLUDE_TEST_MAIN. Probably you could create some fancy command line that would strip main out of the object file if you don't need it, but I think the
-D thing is the best way to go.
I don't really get what you mean with »but it occurred to me, that clang may already be telling me on its own. Somehow...« - if you fear a name clash, than just take a name, clang will definitively not use, like
-DMIKHAIL_T_INCLUDE_TEST_MAIN; if this is not what you meant, then you should clarify that point.
stuff.c, you could create
stuff.main.c and test compile like so:
gcc stuff.c stuff.main.c -o stuff.test
(effectively moving main out of the file.)