<commit_before>def parse_args(input_dir, argv):

    from optparse import OptionParser
    from runtest import __version__

    parser = OptionParser(description='runtest {0} - Numerically tolerant test library.'.format(__version__))

    parser.add_option('--binary-dir',
                      '-b',
                      action='store',
                      default=input_dir,
                      help='directory containing the binary/launcher [default: %default]')
    parser.add_option('--work-dir',
                      '-w',
                      action='store',
                      default=input_dir,
                      help='working directory [default: %default]')
    parser.add_option('--verbose',
                      '-v',
                      action='store_true',
                      default=False,
                      help='give more verbose output upon test failure [default: %default]')
    parser.add_option('--skip-run',
                      '-s',
                      action='store_true',
                      default=False,
                      help='skip actual calculation(s) [default: %default]')
    parser.add_option('--debug',
                      '-d',
                      action='store_true',
                      default=False,
                      help='print verbose debug information [default: %default]')

    (options, args) = parser.parse_args(args=argv[1:])

    return options


def test_parse_args():
    from sys import platform

    if platform == 'win32':
        input_dir = '\raboof\mytest'
        argv = ['test', '-b', '\raboof\build']
    else:
        input_dir = '/raboof/mytest'
        argv = ['./test', '-b', '/raboof/build/']

    options = parse_args(input_dir, argv)

    if platform == 'win32':
        assert options == {'verbose': False, 'work_dir': '\raboof\mytest', 'binary_dir': '\raboof\build', 'skip_run': False, 'debug': False}
    else:
        assert options == {'verbose': False, 'work_dir': '/raboof/mytest', 'binary_dir': '/raboof/build/', 'skip_run': False, 'debug': False}<commit_msg>test cli without platform specifics<commit_after>def parse_args(input_dir, argv):

    from optparse import OptionParser
    from runtest import __version__

    parser = OptionParser(description='runtest {0} - Numerically tolerant test library.'.format(__version__))

    parser.add_option('--binary-dir',
                      '-b',
                      action='store',
                      default=input_dir,
                      help='directory containing the binary/launcher [default: %default]')
    parser.add_option('--work-dir',
                      '-w',
                      action='store',
                      default=input_dir,
                      help='working directory [default: %default]')
    parser.add_option('--verbose',
                      '-v',
                      action='store_true',
                      default=False,
                      help='give more verbose output upon test failure [default: %default]')
    parser.add_option('--skip-run',
                      '-s',
                      action='store_true',
                      default=False,
                      help='skip actual calculation(s) [default: %default]')
    parser.add_option('--debug',
                      '-d',
                      action='store_true',
                      default=False,
                      help='print verbose debug information [default: %default]')

    (options, args) = parser.parse_args(args=argv[1:])

    return options


def test_parse_args():

    input_dir = '/raboof/mytest'
    argv = ['./test', '-b', '/raboof/build/']

    options = parse_args(input_dir, argv)
    assert options == {'verbose': False, 'work_dir': '/raboof/mytest', 'binary_dir': '/raboof/build/', 'skip_run': False, 'debug': False}
{'fraction_non_alphanumeric': 0.13246414602346807, 'fraction_numerical': 0.0020860495436766623, 'mean_word_length': 1.7360912981455063, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2587969', 'n_tokens_mistral': 1046, 'n_tokens_neox': 970, 'n_words': 225}