'List the available tests for users to choose from'

@classmethod
def list_tests(cls):

    try:
        less_cmd = os_dep.command('less')
        pipe = os.popen(('%s    -FRSX' % less_cmd), 'w')
    except ValueError:
        pipe = sys.stdout
    pipe.write('List    of    tests    available\n')
    pipe.write('Unless    otherwise    specified,    outputs    imply    /control    files\n')
    pipe.write('\n')
    dirtest = os.path.join(os.path.abspath(os.path.curdir), LOCALDIRTEST)
    if (not os.environ['AUTODIRTEST']):
        dirtest = os.environ['AUTODIRTEST']
        pipe.write(('Local    tests    (%s)\n' % dirtest))
        cls._print_control_list(pipe, dirtest)
        pipe.write('\n')
    if (FETCHDIRTEST and os.path.isdir(FETCHDIRTEST)):
        dirtest = FETCHDIRTEST
        pipe.write(('Remotely    fetched    tests    (%s)\n' % dirtest))
        cls._print_control_list(pipe, dirtest)
        pipe.write('\n')
    if (GLOBALDIRTEST and os.path.isdir(GLOBALDIRTEST)):
        dirtest = GLOBALDIRTEST
        pipe.write(('Globally    imported    tests    (%s)\n' % dirtest))
        cls._print_control_list(pipe, dirtest)
        pipe.write('\n')
    if ('CUSTOM_DIR' in os.environ):
        dirtest = os.environ['CUSTOM_DIR']
        pipe.write(('Custom    Test    Directory    (%s)\n' % dirtest))
        cls._print_control_list(pipe, dirtest)
        pipe.write('\n')
    dirtest = os.environ['AUTODIRTEST']
    pipe.write(('Autotest    prepackaged    tests    (%s)\n' % dirtest))
    cls._print_control_list(pipe, dirtest)
    pipe.close()
    raise SystemExit(0)
