[interfacekit] Re: CppUnit frustrations

>
>I knew I'd have to break down and learn to use CppUnit, but I'm 
apparently 
>missing something - perhaps a clue or two - because I can't seem to 
figure 
>out how to get it to compile, even the sample code. I'd like to be able 
to 
>write some BHandler tests.
>
>--DW

        What I did was throw all the CppUnit stuff from test/framework and 
test/textui into a BeIDE project and linked it into a .so (I threw out 
the main() function from TestRunner), and I just link that into my own 
test application project.  I had to make a couple of weird tweaks to 
CppUnit to get it to compile, though.
        In a couple of the header files there are some multi-line macros 
(TestCase.h and Guards.h, according to my last-modified file dates) that 
the compiler was just choking over.  At a glance they looked fine; the 
problem was the files were using DOS line endings, and so the backslash 
wasn't the last character before the linefeed (\r\n rather than the BeOS 
\n), and so the preprocessor barfed on a badly formed macro.  When I 
saved the file in Be format with the IDE, it worked fine.
        Also, estring.h was missing an include for <stdio.h>, and TestCaller.h 
was missing an include for <memory> .

        Graham



Other related posts: