kr/ct — pull request #4 by astrieanna (2011-12-02 05:19:47+00:00)
Title: Adding optional ctsetup and ctteardown functions to ct

Hi,

This code allows for each \*-test.c file to define its own ctsetup and ctteardown function. For each test in that file, ctsetup will be run before the test and ctteardown will be run after. If neither of these are defined, then behavior is the same as currently.

A side effect of these changes is that you can define tests of the same name in different \*-test.c files. We felt that this was a feature. All ctsetup, ctteardown, and cttest\* functions are renamed by gen to have the filename (with underscores replacing non-alphanumeric characters) appended to the original function name. This probably hurts readability of error messages a little bit (since the new names are displayed).

I tried to keep my code in the same style as the rest of ct, but if there's anything you'd like changed, I would (of course) be happy to make the changes.

-- Leah, Carolyn, and Josh