I've hooked cpptasks into Maven (i was unaware of the plugin when i started this work) and i'm building my C++ library and the implemntation code for its
system tests. This seems to work fine.
I've also hooked in SysUnit to do my system tests. So i've got my system tests mainly coded in Java and run through SysUnit but they are implemented in a C++ library, which I build through cpptasks.
So the point of doing this is to use maven to build and test this C++ library!
Anyway, my C++ system tests are crashing and i'm not getting any logging out because of the way junit/ant works...they emit logging after the test is completed, as far as i can see? So using printf throughout my system tests is not working as
i dont see the logging before the test crashes and the JVM bails out.
I'm after some ideas for debugging my C++ stuff. I'm using MS Dev Studio. Can i 'run' a DLL in there and specify my Maven stuff as the client somehow. I seem to remember from 5+ years ago when i used to use this stuff regularly, that maybe possible. Then i could launch the DLL inside MSDev and see my maven console box pop up, my test would execute and wind its way down to my breakpoint in MsDev.
Is this possible? If not, can anybody suggest another debugging strategy...
If you can add calls to Win32 API OutputDebugString method to your code, you should be able to see the messages using a OutputDebugString viewer like DebugView (http://www. sysinternals.org/ntw2k/freeware/debugview.shtml) which can monitor all calls to OutputDebugString on all processes.
Using log4cxx (http://logging.apache.org) would give you other options, logging to file, logging to sockets. However the OutputDebugString appender was added since the last release.
Depending on what you are trying to do, calling the DebugBreak API method might be what you are looking for. It typically will cause the installed debugger to be started or control to be stopped if already attached to a debugger.
I have now managed to get my maven build driven out of Visual Studio and i have my DLL code sitting inside the debugger waiting for break points to be hit...but no joy yet...keep trying
Thannks for the tips on the loggers...think i may end up doing that.
Log in to post a comment.