Integrated unit testing framework with scons on Linux.
authorArystanbek Dyussenov <arystan.d@gmail.com>
Tue, 7 Jul 2009 08:38:18 +0000 (08:38 +0000)
committerArystanbek Dyussenov <arystan.d@gmail.com>
Tue, 7 Jul 2009 08:38:18 +0000 (08:38 +0000)
commitad0b2c87d5c86b56f073c81f25df5c3988911d14
treefb9ae87ae22b5a58e629936a0b2b839e3bf32cc1
parent2a23fda9d55034e524be32bd8cb196ae4cd93920
Integrated unit testing framework with scons on Linux.

I needed this to make sure that BKE_copy_images works properly,
probably will be useful in future.

Using Check framework (http://check.sourceforge.net/doc/check.html/index.html).

WITH_BF_UNIT_TEST option builds 'alltest' program under [BUILDDIR]/bin,
which, when executed, runs unit tests, currently only 1.

Example output:
----------------------------------------------------------------------
Running suite(s): Image
0%: Checks: 1, Failures: 1, Errors: 0
tests/alltest.c:74:F:Core:test_copy_images:0: Expected //bar/image.png to be translated to /tmp/bar/image.png, got /tmp/bar/image.pn.
----------------------------------------------------------------------

Spent lots of time (a couple of days actually :) to figure out how to
link the test program with Blender libraries. As it turned out there
are circular dependencies among Blender libraries. GCC by default
doesn't expect circular dependencies - dependant libs should precede
libs they depend on.

The magical --start-group linker option helped to solve this
(http://stephane.carrez.free.fr/doc/ld_2.html#IDX122).

Also:

- added bpy.util module. bpy.sys.* functions will move here later
- added bpy.util.copy_images that uses BKE_copy_images
- export_obj.py uses bpy.util.copy_images
SConstruct
release/io/export_obj.py
source/blender/blenkernel/BKE_image.h
source/blender/blenkernel/SConscript
source/blender/blenkernel/intern/image.c
source/blender/python/intern/bpy_interface.c
source/blender/python/intern/bpy_util.c
source/blender/python/intern/bpy_util.h
tools/btools.py