A convenient #define is part of VectorCAST. When VectorCAST/C++ preprocesses a unit under test, it defines VECTORCAST. Thus, if you want to run some code in your source file only when it is used in a VectorCAST environment, you can add the following to your source code:
... code here ...
VECTORCAST will be defined when the unit is preprocessed during environment build.