[Xapian-discuss] PHP Bindings

Olly Betts olly at survex.com
Wed Sep 8 20:46:48 BST 2004


On Wed, Sep 08, 2004 at 03:33:30PM +0100, James Aylett wrote:
> On Wed, Sep 08, 2004 at 02:54:38PM +0100, Olly Betts wrote:
> 
> > > Could we have a slightly bigger one that tests the core Xapian
> > > functionality through InMemory?
> > 
> > Yes, but I don't really have the time to mess with this - I've a lot
> > of core library stuff I want to sort out.
> 
> Can you at least create a Document object? Because the stemmers are
> somewhat disjoint from the rest of the library, I'd like to see the
> main bit working, however trivially.

I've added "smoketest.py" which creates a document and adds some stemmed
terms.  I did try to add the document to an inmemory database, but as
far as I can tell Xapian::InMemory::open() isn't available in the SWIG
bindings!

I think we need a "TODO" list for the bindings...

> > The gain from having a test which shows the extension loads and can be
> > called is substantial and the effort is small.  More extensive tests
> > would be useful - ideally we'd check that as many methods of as many
> > classes as possible can be called and give sane results.  I'll leave
> > that as a project for someone else.
> 
> It's on my list for Python bindings, but I want to fix exceptions
> first.

Cool.  A useful approach is probably to go through the C++ apitest and
translate all the feature tests (ignoring regression tests and
consistency tests) so that ideally every method is exercised.  You can
largely rely on the C++ code working the same way - the important bit
to test is the binding part plus any language specific extensions.

> I think we want a minor version bump if we drop is_empty(), so if
> we're at a patch level and the moment we probably want to leave them
> in for now.

Makes sense.  I think it's just a matter of using %extension.

Cheers,
    Olly



More information about the Xapian-discuss mailing list