If you need the Visual Studio project path, during compilation you can use the Pre-Build Event (see the Project Properties dialog box) to run a command line that will create the source file used in your project.
The source file will contain some code, say, a variable definition. Your test code uses this variable. The value of the variable will be obtained from VS; when he runs the Pre-Build Event command, it replaces the project properties for specific macros. The macro you want is probably ProjectDir.
So, at the end, you have something like this for the Pre-Build Event command:
echo 'const char * PROJECT_PATH = "$(ProjectDir)";' > source.cpp
Not sure which language you are using, so configure accordingly.
source share