Re: Unit tests in Python using GObject Introspection



Hi,

I'll reply to Iago and Edu's emails here:

Iago said:
> About the unit tests in general, I think it is a good idea, but I
> wonder how they mix with having a clone of the test-ui in Python
> already. I wonder if we want to use and maintain that test-ui clone to
> test the python bindings or if we rather use unit tests (maintaining
> both at the same time looks like too much work to me). Then if we want
> to test also other ports like javascript or vala I wonder if we want to
> write tests/uis for each one... I guess having a good set of unit tests
> could be a better way, but I would like to see other opinions.

Well, while having the test-ui was a good way to measure the matureness
of the introspection bindings, I don't think it's exhaustive enough to
consider it as worthy as a good set of unit tests. However, writing
those unit tests is also time consuming (considering that we want to
test both the functionality and the bindings).

Anyway, for a developer trying to create his own application using GI
bindings I think it would  be better to have a test-UI he can explore,
instead of having him digging through the docs, unit tests, and C code.

So, while I understand the problem of having to maintain both things, I
don't know which one is more important than the other.

> As for the location of the tests I would go for src/tests/python

I'll comment this after Edu's email

Edu said:
> Hi,
> 
> It is embarrassing to say that I already volunteered to write test units
> back in May, but failed to actually allocate time to push it forward (I
> guess I moved it down in my priority list). I sincerely apologize.
> 
> http://mail.gnome.org/archives/grilo-list/2010-May/msg00041.html

Nice! I haven't ready this email when I sent mine: I wondered how was
JS's support of unit tests. Even if we'd have to implement them, it's OK
it's already discussed.

> I won't say I will start devoting many hours to this right now, but we
> can join forces and try to have a basic test unit foundation where we
> can harvest more incrementally. I still think they are necessary.
> The idea of separating them in a folder for each language seems good to
> me as we will want to have test units for Pyhton, Vala, JS and any other
> lang supporting GI. Though I think they should not be placed within src,
> but in /test. Mixing actual library code with testing (metdata) code
> doesn't seems right to me, but I don't feel strongly about it anyway.

Well, the common opinion is to place each language's tests under a
different directory. I also think that having them under test/ instead
of src/test would be clearer, but don't have a strong opinion.

Once we settle this, I'll resend the patches I've already done.

Best regards,

Simón


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]