create wiki

go home go home
  1. about
  2. code
  3. wiki
  4. blog

Testing

From Create Wiki

Jump to: navigation, search

Currently, two components have tests: Bindable and Engine. The only other components which might get their own tests are dC and Script, as both are somewhat independent. The other components, such as Create, are tested through the engine.

To run the tests, do the following (this assumes you have already compiled Engine):

cd Engine/Tests/tests-bcompare
python run-bcompare.py


Misc. Thoughts

There are many challenges in testing the framework. Some components are simple: Common, for example, has components that are easy to test. Create, on the other hand, is much more difficult.

It may be best to not directly test Create or Spec at all, but instead put tests under Engine. There would likely be two kinds of tests: binary comparison tests, where output is compared byte-by-byte to a known good result, and view tree tests, where the view tree is compared.

Of these, the byte-by-byte comparison is clearly much easier. The view tree has two challenges: one, we'd have to generate dumps of the view tree. The actual generation isn't too bad, as there is actually a function to allow dumping — it just needs to be implemented in all of the subclasses. The tricky bit is figuring out how to trigger dumps. The only idea currently is to trigger the dumps when a Status changes... for instance, each print framework view could have a "commit" status that triggers on commit. The status could then be hooked up to something else to act like a breakpoint of sorts, allowing triggering of a view dump.

Finally, Bindable needs a nice way to dump its binding information for application debugging purposes.

Personal tools