Forum OpenACS Development: Response to A way forward for regression testing.

Collapse
Posted by Peter Harper on
Thanks for pointing out the issue with the bootstrapper Peter. On the issue of examples. I did put together some tests for the news package back in the days of the pre-4.5 release (yep, that long ago). I stuck them in the file-storage here

However, these are almost a year old now, and I don't know whether they will still work. Should be a good reference for how to use the extra functionlity though. It makes use of stubs, init classes and components.

Respectively, these are:

  • Stubs are for temporarily providing your own implementation of a procedure, thus allowing you to drive the flow of control through the function under test
  • Init classes. These are chunks of code that a number of test cases may share. You register a testcase against an init class. When a set of tests are run. An init class constructor is called *once* before running all tests, and the destructor is called *once* after all the tests have run. The idea being you could share a init-class that mounts the package under test, then unmounts it, and it only happens once for all tests.
  • Components are meant as reusable chunks of test code. Much like test subroutines. I'm not particularly happy with the current implementation, and I think this'll be one area that'll get tidied up as time goes on.

Hmmmm. Hope that's answered all the questions......