TEST_FAILED should allow a custom destructor / command to be called prior to aborting
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
libnih |
New
|
Undecided
|
Unassigned |
Bug Description
Currently, if a test that uses NIH fails, TEST_FAILED() is called, which displays a message then calls abort(3).
As a convenience to the user, particularly to handle those scenarios where the tests are being run in an automated fashion on a system they have no access to (for example a buildd), it would be useful to provide potentially 2 facilities:
(1) TEST_FAILURE_
A facility to register a void (*)(void) function that is called prior to abort(3).
(2) Have TEST_FAILED() check the value of the environment variable "NIH_TEST_
system (getenv ("NIH_TEST_
There are potential security implications of (2), but surely nobody builds as 'root' or grants the test user full sudo access right? :-)