The new emerging NLE for GNU/Linux
State Dropped
Date 2007-06-17
Proposed by Ichthyostega

UnitTests in Python

Use the Python scripting language for the actual Unit Tests and access the Cinelerra Code via SWIG


Define Test classes in Python, using e.g. the PyUnit framework of the Python Standard lib. The SWIG compiler can generate wrapper code automatically, so we can access the C++ Classes and Facilities of Cinelerra as Python Modules and Classes. The Classes to be tested in Cinelerra need to provide some Interface for carrying out these tests (and this is one of the main benefits of the whole Test driven aproach).


  • Find out how the SWIG generated wrappers play together with Python’s List and Map types. Without the ability to use the latter in the tests, this whole proposal is rather pointless.

  • Think on how we can test video data processing (at least in its basics, e.g. does additive overlay work)


Programming Unit and Self tests in a Scripting language facillates this task. The X-Language bindings are quite usable today. As a side effect, it helps to get a clean program structure, because the tests need some Interface and/or some object factories to create the test candidates. Python is proposed, because it is fairly mainstream, has a flat learning curve and but is moderately modern and functional-style at the same time.


  • Adds to the complexity

  • Some old-style hackers have a quite distinct aversion against Python



Why am I proposing this? Out of lazyness. Python is there, many devs (on linux) have some Python skills, SWIG is not overly complicated to use.

And last but not least: just to get the discussion going… ;-)


  • I’d rather consider to use some embedded language in cinelerra which we can use to drive tests, should be something smaller and more sane than python. Needs certainly more discussion. For simple unit tests some C/C++ harness and bit shell scripting would suffice, I really want to integrate this with NoBug.  — ct