利用者:LeifAndersen/GSoC2010/RenderTests
(This will be formatted soon):
~Blender Render Regression Test Tool~
The Blender Render Regression Test Tool is a tool to help busy developers quickly run render based regression tests on blender, as well as aiding in the creation of more generic unit testing tools where Render Tests are needed.
Requirements:
To run these tests you need:
- python 2.x, and all of the associated libs - PIL (Python Imaging Library), for whatever version of python you have
Quickstart:
The images required to compare image tests are built into the package, simply go into the test directory and run:
python run.py
if blender is not in your path run:
python run.py -b <Location of your testing blender binary>
Running the animation tests:
The animation tests require much more space, and take much longer to run. However, on the off chance you do want to run them, you can use the --with-animations flag in order to run your animation suite. Go get a coffee, or a full blown out meal while your waiting though, or you could get some other work done, these tests will take a long time to complete.
Because of the size of these tests, the needed images to compile them were not included in this package. In order to get them, download the animation_images package, and extract it to the same location you placed this folder in your filesystem. If you don't want to download the tests, and you have a good copy of blender on your system, you can build the needed files, simply run:
python run.py --build-tests --with-animations
or if the good blender binary is not in your path, run:
python run.py --blender-tests --with-animations --good-blender-bin=<Your good blender binary>
However, this option will take a long time as well. Note that when running the animation tests, you will see the output blender gives as the animation is rendering.
Viewing the test output:
The tests report whether or not they passed while they are running, but more data can be viewed with an HTML file the tests generate. This file gives a list of the pixels that can be considered different, as well as the percentage of difference for each image. It also shows the good image along side the most recent test image, and a diff of the two images. Finally, if the test was an animation, the name of the test becomes a link to another HTML file, containing this data for every frame in the animation.
Note that this feature is still a bit buggy, and while the webpage is still very usable in most browsers, many will not output a page that has a completely clean theme.
Running additional images and animations:
The suite is also capable of running additional animations and images outside of the ones in the folder. To use this mode simply use the -i or -a (but not both) flags to represent image and animation respectively. Then, simply insert the location of the blend file you would like to compare.
Note that a specific file structure is still required for these tests to work properly. For images, it expects there to be a folder in the same directory the blend file is in, named 'render', in it, it expects a png file of the same name as the blend file, except replacing .blend with _0001.png. For animations, it requires a folder with the same name of the blend file (without the blend), with PNG output of the blend file. Note that you need to use the default settings for these png files for the tests to work properly.
Odds and ends:
-v shows the output of blender as it renders single images, and -h shows a list of all the parameters.
Final notes:
This suite was made by Leif Andersen for the Blender Foundation as a GSoC (Google Summer of Code) project. For more information, or to contact me, you can go to:
- http://wiki.blender.org/index.php/User:LeifAndersen/GSoC2010
and if that's off line for some reason, you can probably also find me at:
- http://leifandersen.net
I also am on #blendercoders and many other Freenode channels, my nick is Leif