function add_test_done_callback(test, callback)
    {
        if (test.phase === test.phases.COMPLETE) {
            callback();
            return;
        }

        test._done_callbacks.push(callback);
    }
Mark the test as complete.

This sets the test status to ``PASS`` if no other status was
already recorded. Any subsequent attempts to run additional
test steps will be ignored.

After setting the test status any test cleanup functions will
be run.