[Soc-2010-dev] Status Report (testing-week 3)

Leif Andersen leif at leifandersen.net
Sat Jun 12 00:14:15 CEST 2010


As mentioned last week, this week consisted mainly of debugging parts of
blender.  As such, I believe that the amount of actual deliverables I
produced this week is much less than it has been the first two weeks.  With
that being said though, I believe that I have learned more about the blender
codebase than the other weeks, by quite a bit.  I also found several tricks
for the python API that weren't documented in the API documentation, which
should eventually make the tests much cleaner.

This week I started working with tests for operators as apposed to directly
with data.  The first problem I ran into was the immutability of
bpy.context.  I was resorting to hacks to change the context, which only was
working some of the time.  Thus, I went to GTest, giving it more time than I
had planned on this week (a little over a day), because the C-API calls took
in a bContext, rather than having it be implicit.  However, I never managed
to get the linking right, any probes I put into the kernel or operators
itself would result with many errors, even for functions that seemed to only
allocate space, thus I never got a bContext made.

Fortunately ideasman42 pointed out to me that I could pass in a dictionary,
and the operators would use that instead of the value in bpy.context.  I
haven't gotten it to work in all of the situations I've tried (yet), but
many have worked, and it does seem promising.  However, that only solves
some of the tests, it still would be valuable to run tests using
bpy.context, or some other type of implicit context, for better code
coverage.

One thing that I really didn't expect this week, was that most of the bugs I
was trying to debug this week, were ones that I found.  I was planning on
looking for bugs on projects.blender.org, and I did find a few, but when I
started building python scripts to test them, I found many more simple
problems that  I had to deal with first, which took most of my time.

My plans for next week:

My first order of business is to get several operators in bpy.ops.wm (mostly
found in the windowmanager folder), working in the python console, and in a
script (both when blender has a visible, and no visible window).  Currently,
I'm working on bpy.ops.wm.read_homefile(), and I've made some progress.
 However, the problem is that the bContext that is passed into it has
several null elements in the console, which is expected to be non-null for
windowmanager operations.  Once I've finished that, I will finish my
setup.py test, and proceed to use that as my setup method, at which point
most of my tests module will become superfluous, and I may take some time
dealing with that.  In fact, I could likely get rid of it, with the one
exception of me using it's hashcode function.  I may also read in a
pre-built empty file, rather than the default .b.blend file, which could
possibly break the tests if the default was changed, which would be very
bad.  Finally, as a side project, I'm going to start reading up on how the
python API's documentation is made (I know it's using sphinx, but I don't
know how it works, yet), and I'll see what I can do to start helping
minddrones with that.

~Leif Andersen

----------
That was easy:
http://www.appbrain.com/app/net.leifandersen.mobile.android.easybutton
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.blender.org/pipermail/soc-2010-dev/attachments/20100611/d05c5aed/attachment.htm 


More information about the Soc-2010-dev mailing list