Skip to content
cnlbob edited this page Aug 1, 2015 · 22 revisions

Overview of the CellBlender Test Suite:

The CellBlender Test Suite consists of a somewhat simple add-on designed to help developers quickly run through a series of CellBlender tests. As of this writing, the test suite contains 22 tests and it takes less than 2 minutes to run through all of them.

The test suite works by invoking the various Blender/CellBlender operators and setting various Blender/CellBlender properties. Eventually, each test generates an MDL file which is checked against a "known good" MDL file for that test. If they match exactly (comparison of SHA1 hash), then the test passes and a green check mark appears with the word "Pass". If they don't match exactly, Blender exits immediately ... so there is little chance of not noticing a failure!!

The test suite starts each test by completely reinitializing the CellBlender add-on and then invoking the operators and setting the properties needed for the test. That means that CellBlender should NOT typically be enabled when running the test suite. The test suite will do that automatically for each test.

Resetting after each test is done by reloading the startup file. In other words, the startup file should contain the desired pre-test configuration of Blender. That will be the configuration of windows, panels, etc that you want to have for the start of each test. All objects in the scene will be deleted by each test anyway, so it's suggested that all objects (cube, camera, lamp...) be removed before saving the startup file to eliminate any confusion. The CellBlender Test Suite panel has convenient buttons for "Load Startup" and "Save Startup" to make this easier.

The primary goal of the CellBlender Test Suite is to make quick checks of CellBlender ... not MCell. The focus is on ensuring that a known sequence of CellBlender operations will produce the proper set of MDL files. For that reason, it is typically not necessary to run MCell to verify the passing of each test. However, it's sometimes helpful to run MCell anyway to observe the results. For that purpose, the CellBlender Test Suite contains a "Run MCell" check box. If that box is checked, then MCell will be launched for each test, and the test suite will wait for the MCell run to complete (Note: at this time the test suite waits a fixed amount of time for MCell to complete since it doesn't contain code to check for completion). If a series of tests are to be run, it's a good idea to set the status of the "Run MCell" and save it in the startup file so it will be set properly after the "Load Startup" before each test.

Running a series of Tests:

Start by preparing to run the CellBlender Test Suite as described below (that's the hardest part). Then open the panel for the tests that you want to run ("Simple Geometry Tests" for example). Since you'll be reloading the startup file after each test, and since you don't want to have to reopen the test panel each time, simply save the startup file with the panel open. Then when you reload the startup file, it will still be open. The same is true with the "Run MCell" check box - set it and then click the "Save Startup" button.

Once all that is done, the testing is very easy. Just click each test and wait for the result (question mark turns to green check ... or Blender exits). After each test has passed, click the "Load Startup" button and run another test. When you've run all the tests in one group, click "Load Startup" one more time, close the panel you've been testing, open another testing panel, and save the startup file again. Then repeat the process of "Load Startup", run a test, observe results, "Load Startup", run a test, observe results, ...

Preparing to run the CellBlender Test Suite:

  1. Create a directory (folder) for your testing files and start Blender from that location.

  2. Start with a fresh startup file ( File/Load Factory Settings, File/Save Startup File, File/User Preferences/Save User Settings, close )

  3. Enable the CellBlender Test Suite: ( File/User Preferences, Add-ons, Cell Modeling, CellBlender Test Suite, Save User Settings, close )

  4. Properties Panel, Scene tab, collapse all sub-panels except "CellBlender Test Suite"

  5. Set Path To MCell Binary, collapse "Setup Panel", click "Save Startup" button

  6. Configure windows and other features as desired for testing, click "Save Startup" button again.

Other Uses for the CellBlender Test Suite:

In addition to running a series of tests, the CellBlender Test Suite can be used for demonstrations and to generate starting models for additional experimentation. For example, the E.coli MinD/MinE system is available as one of the test cases. To use that model as a "baseline", simply run that case (following the steps listed above) with the "Run MCell" button disabled. That will build the entire model and it will be ready to run. Just save the blend file in the location of your choice, and open the normal CellBlender tab to make changes or run.