lundi 1 juin 2015

Define pre-processor flag in one project and use it in another

I have a notification service responsible for emailing a variety of external clients based on specific criteria's. Obviously, we route all notifications using pre-processor directives to internal emails when testing in QA. I have a suite of unit tests that verify which email address will be used. Problem I have is that my unit tests verify whether criteria foo (for example) would send an email to client #1. But, due to our pre-processor flags, always fails.

Is it possible to set pre-processor flags in one project (i.e. unit test project) and use it in another? This way I could set a flag (e.g. TESTING) and check it in my main project. If the TESTING flag is set, then don't route notifications to local addresses.

Aucun commentaire:

Enregistrer un commentaire