I'd echo what Holger says here, introducing a C-level unittest framework
seems very reasonable (needed even!) and it allows you to test internals
which are not exposed on the public API (which is a limitation of the
python-level tests currently). Hooking the C-level unittests up in
meson.build so that "ninja test" works would be a great next step, but
I don't think it should block the tests from being merged in the first
place - this is probably quite a different problem.
Cheers,
Floris
On Fri 29 Mar 2019 at 23:55 +0000, deltachatmailinglist(a)netc.fr wrote:
> I have added a new feature to Delta Chat core, namely the [detection and removal of
subject prefixes]. I prefer to have unit tests early during the development and I
didn't find any existing ones in the repository. So I used [MinUnit] as a basis to
quickly set up a C test framework and wrote my tests with that.
>
> In the meantime, I have asked around and have been pointed to the Python tests where
I've been told that the C methods would automatically be available via
`deltachat.capi.lib`.
>
> I ported my tests to Python, but they don't work because I can only access the
existing C methods, not my added ones. I think it's because I followed the Readme
which instructs to install the bindings via Pip so they can't possibly contain my
code. But also when I analyse the symbols in the generated
`python/src/deltachat/capi.*.so` files, my methods are missing.
>
> I should note that I added my new files to the Ninja build, the methods are contained
in the compiled `build/src/libdeltachat.so` and I called `sudo ninja install` as mentioned
in the Readme.
>
> My two questions therefore are:
>
> 1. How to make the compiled `capi*.so` files reflect the current C code in the
repository?
> 2. How to use these bindings in the tests?
>
>
> [detection and removal of subject prefixes]:
>
https://github.com/deltachat/deltachat-core/issues/126
>
> [MinUnit]:
>
http://www.jera.com/techinfo/jtns/jtn002.html
> _______________________________________________
> delta mailing list -- delta(a)codespeak.net
> To unsubscribe send an email to delta-leave(a)codespeak.net