malsyned / pfstest

Professional Firmware Services Unit Test Framework
Other
1 stars 0 forks source link

One setup() and one teardown() function per file #17

Closed malsyned closed 6 years ago

malsyned commented 6 years ago

It isn't useful to have multiple before() and after() functions defined in a single file. The order they are executed can't be guaranteed, and having to name them, and name them something different in every file since they're external identifiers, is cumbersome and inconsistent with how other unit test frameworks operate.

Replace this with simple setup() and teardown() functions which are defined statically and which each of the tests maintain a pointer to so the core can access them.

malsyned commented 6 years ago

I got this to work, and as a bonus, the user doesn't have to define a setup() or teardown() block unless they want to put code in them.