Sunday, 15 January 2012

visual studio 2010 - Developing C++ DLL with executable unit test that compiles and links at the same time? -



visual studio 2010 - Developing C++ DLL with executable unit test that compiles and links at the same time? -

i'm developing c++ project in visual studio 2012 uses driver code interface open dmx box(enttec dmx usb pro). far, i've been writing code , compiling exe utilize main() run unit tests.

i want port on have device interface code compiles downwards .dll, separate source file contains c++ code compile exe links dll , makes calls functions run tests.

essentially, when go debug, there way setup visual studio 2012 generate .dll , .exe making calls .dll , run .exe automatically in 1 step? i'm new visual studio , find quite confusing.

yes. setup 2 projects in solution: 1 main code (generating dll) , 1 executable, unit tests reside. under project dependencies (under project menu on vs2010, not sure 2012) create exe dependent on dll (that create sure exe rebuilds/relinks when necessary).

right-click on exe project in solution explorer , select properties. there can setup includes/linker header/lib file, if necessary (it might not necessary if utilize loadlibrary explicitly or something, i'm guessing you're not doing that).

now in project settings exe under build events, add together post-build event runs tests. note if exe returns other 0 main(), vs can study error in build.

c++ visual-studio-2010 visual-studio unit-testing dll

No comments:

Post a Comment