From: William S F. <ws...@fu...> - 2011-04-28 21:04:01
|
On 15/04/11 01:39, Jason E. Aten wrote: > On Fri, Apr 1, 2011 at 2:42 PM, William S Fulton > <ws...@fu... <mailto:ws...@fu...>> wrote: > > As SWIG has no runtime example anywherer for cffi, yours would be > the first. This module is badly in need of runtime tests and the > minimum required is a copy of the 'simple' and 'class' examples, so > I suggest you turn your example into the 'simple' example. I don't > really like to have different examples for each language module, > unless testing a specific language module feature. There isn't a > single runtime test and I don't accept many patches without a > runtime test these days, so you'd need to add one in. The test-suite > is documented quite well here: > http://www.swig.org/Doc2.0/Extending.html#Extending_test_suite , but > if you have any questions please ask. The top level Makefile is > currently missing cffi test-suite and example support too, so that > needs adding in too unfortunately. > > > Hi guys, > > The good news is, I've got a much improved CFFI module going. But I'm a > little stuck now that I'm trying to figure out how to hook in my CFFI > module tests to the swig testing machinery. > > I read through the docs William mentioned above, but I'm confused about > a couple of things. I'm hoping someone can clarify. > > First, how do I get my Example/cffi/* tests to run immediately. When I > do make-cffi-test-suite, it starts a very long (on my slow box) chain of > other tests. 'make check-cffi-test-suite' should run the test-suite and 'make check-cffi-examples' should run the examples. For the latter, you need a check.list file plus a Makefile in each example directory plus appropriate make rules in the Examples/Makefile.in file for the Examples/Makefile which is generated after configure. > Secondly, I've looked through some of the stl.i and > stl_vector.i code in the r module to get a feel for what they are doing, > but I'm somewhat confused about what I should put in those required files. > These provide wrappers for the STL. Although the preprocessor is over used in these files, these files are simply providing wrappers for the STL containers, eg std_vector.i defines the std::vector class. Run 'swig -E' on any .i file to view the preprocessed contents. Also take a look at std_vector.i for some of the other languages, it might be easier to understand, eg go is quite simple. William |