From: ptkwt@...1.aracnet.com (Phil Tomson) Date: 2002-06-16T03:54:51+09:00 Subject: SWIG and Ruby for C++ unit testing In article <3D0A02CA.2040503@users.sourceforge.net>, Lyle Johnson wrote: >> Can someone clarify how this is supposed to work? > >For what it's worth, I had answered Phil privately on this question >before I saw that he'd asked here also. The basic answer is to use a >combination of "argout" and "ignore" typemaps to tell SWIG that those >arguments should be wrapped as output values. Thanks Lyle, your soulution worked. For those interested in unit testing of C++ classes: I'm working on a contract at a large company (everyone would know the company if I named it, but I won't for now) and we're developing a C++ class library. We have a need to do unit testing (I've managed to convince them that we do need to have some unit tests) of these classes. I tried CppUnit and after a couple of hours of playing with it couldn't get it to work. Then I decided to wrap the C++ classes with Swig and use Ruby's Test::Unit unit testing framework - I managed to get the first couple of classes 'swig'ged and tested them out in Ruby in about 30 minutes (the guy I'm working for on this contract was favorably impressed). So far it's working great (especially since Lyle's suggested typemaps). I'm impressed with the latest Swig (1.3.12). We have an abstract base class that acts as a factory for concrete subclasses - I thought this would be a major headache to wrap with SWIG, but there was no problem at all. ....Now back to 'swigging' more classes ;-) ... Phil