'Return a summary of all the test results.'

def build_summary(self):

    def append_list_summary(summary, name, entries):
        'Write    out    all    the    names    from    the    test    results.'
        if (not entries):
            return
        summary.append('{0}:'.format(name))
        for entry in entries:
            summary.append('        *    {0}'.format(entry[0]))
    options = self.options
    if options.test_disable:
        return ('No    test    output:    testing    was    disabled.', 0)
    summary = ['\nSummary:']
    append_list_summary(summary, 'SKIPPED', self.skipped)
    append_list_summary(summary, 'PASSED', self.passed)
    append_list_summary(summary, 'FAILED', self.failed)
    num_skipped = len(self.skipped)
    num_passed = len(self.passed)
    num_failed = len(self.failed)
    summary.append('')
    if num_failed:
        summary.append('FAILED    {0}    of    {1},    skipped    {2}'.format(num_failed, (num_failed + num_passed), num_skipped))
    else:
        summary.append('PASSED    {0},    skipped    {1}'.format(num_passed, num_skipped))
    return '\n'.join(summary)
