예제 #1
0
                        '-v',
                        action='count',
                        help="Verbosity level",
                        default=False)

    parser.add_argument('--list-checks',
                        '-l',
                        action='store_true',
                        help="Print available checks",
                        default=False)

    args = parser.parse_args()

    if args.list_checks:
        from bakery_lint.base import tests_report
        print(tests_report('upstream'))
        sys.exit()

    for x in args.file:
        if not x.lower().endswith('.otf'):
            print('ER: {} is not OTF'.format(x), file=sys.stderr)
            continue
        failures = []
        success = []
        error = []

        result = run_set('upstream', test)
        failures += [(testklass._testMethodName, testklass._err_msg)
                     for testklass in result.get('failure', [])]
        error += [(testklass._testMethodName, testklass._err_msg)
                  for testklass in result.get('error', [])]

if __name__ == "__main__":
    description = "Runs checks or tests on specified fontbakery project"
    parser = argparse.ArgumentParser(description=description)
    parser.add_argument("file", nargs="+", help="Test files, can be a list")
    parser.add_argument("--verbose", "-v", action="count", help="Verbosity level", default=False)

    parser.add_argument("--list-checks", "-l", action="store_true", help="Print available checks", default=False)

    args = parser.parse_args()

    if args.list_checks:
        from bakery_lint.base import tests_report

        print(tests_report("upstream-repo"))
        sys.exit()

    for x in args.file:

        suite = get_suite(x)

        result = run_suite(suite)
        failures = [(testklass._testMethodName, testklass._err_msg) for testklass in result.get("failure", [])]
        error = [(testklass._testMethodName, testklass._err_msg) for testklass in result.get("error", [])]
        success = [(testklass._testMethodName, "OK") for testklass in result.get("success", [])]

        if not bool(failures + error):
            if args.verbose:
                for testmethod, dummyvar in success:
                    print("OK: {}".format(testmethod))
예제 #3
0
if __name__ == '__main__':
    description = 'Runs checks or tests on specified directory/file(s)'
    parser = argparse.ArgumentParser(description=description)
    parser.add_argument('test',
                        help="Action or target test suite",
                        choices=['*', 'list'] + available_tests)
    parser.add_argument('file', nargs="+", help="Test files, can be a list")
    parser.add_argument('--verbose',
                        '-v',
                        action='count',
                        help="Verbosity level",
                        default=1)

    args = parser.parse_args()
    if args.test == 'list':
        tests_report()
        sys.exit()

    if not args.file:
        print("Missing files to test", file=sys.stderr)
        sys.exit(1)

    for x in args.file:
        failures = []
        success = []
        error = []
        tests = [args.test]

        if args.test == '*':
            tests = available_tests
예제 #4
0
                        '-v',
                        action='count',
                        help="Verbosity level",
                        default=False)

    parser.add_argument('--list-checks',
                        '-l',
                        action='store_true',
                        help="Print available checks",
                        default=False)

    args = parser.parse_args()

    if args.list_checks:
        from bakery_lint.base import tests_report
        print(tests_report('metadata'))
        sys.exit()

    for x in args.file:

        if not x.lower().endswith('metadata.json'):
            print('ER: {} is not METADATA.json'.format(x), file=sys.stderr)
            continue

        suite = get_suite(x, apply_autofix=args.autofix)

        result = run_suite(suite)
        failures = [(testklass._testMethodName, testklass._err_msg)
                    for testklass in result.get('failure', [])]
        error = [(testklass._testMethodName, testklass._err_msg)
                 for testklass in result.get('error', [])]
if __name__ == '__main__':
    description = 'Runs checks or tests on specified DESCRIPTION.txt file(s)'
    parser = argparse.ArgumentParser(description=description)
    parser.add_argument('file', nargs="+", help="Test files, can be a list")
    parser.add_argument('--verbose', '-v', action='count',
                        help="Verbosity level", default=False)

    parser.add_argument('--list-checks', '-l', action='store_true',
                        help="Print available checks", default=False)

    args = parser.parse_args()

    if args.list_checks:
        from bakery_lint.base import tests_report
        print(tests_report('description'))
        sys.exit()

    for x in args.file:
        if not os.path.basename(x).startswith('DESCRIPTION.'):
            print('ER: {} is not DESCRIPTION'.format(x), file=sys.stderr)
            continue
        
        suite = get_suite(x)

        result = run_suite(suite)
        failures = [(testklass._testMethodName, testklass._err_msg)
                     for testklass in result.get('failure', [])]
        error = [(testklass._testMethodName, testklass._err_msg)
                  for testklass in result.get('error', [])]
        success = [(testklass._testMethodName, 'OK')
    description = 'Runs checks or tests on specified METADATA.json file(s)'
    parser = argparse.ArgumentParser(description=description)
    parser.add_argument('file', nargs="+", help="Test files, can be a list")
    parser.add_argument('--autofix', '-f', action='store_true',
                        help="Autofix METADATA.json if test has been failed", default=False)
    parser.add_argument('--verbose', '-v', action='count',
                        help="Verbosity level", default=False)

    parser.add_argument('--list-checks', '-l', action='store_true',
                        help="Print available checks", default=False)

    args = parser.parse_args()

    if args.list_checks:
        from bakery_lint.base import tests_report
        print(tests_report('metadata'))
        sys.exit()

    for x in args.file:

        if not x.lower().endswith('metadata.json'):
            print('ER: {} is not METADATA.json'.format(x), file=sys.stderr)
            continue

        suite = get_suite(x, apply_autofix=args.autofix)

        result = run_suite(suite)
        failures = [(testklass._testMethodName, testklass._err_msg)
                     for testklass in result.get('failure', [])]
        error = [(testklass._testMethodName, testklass._err_msg)
                  for testklass in result.get('error', [])]
예제 #7
0

if __name__ == '__main__':
    parser = argparse.ArgumentParser()
    parser.add_argument('action', help="Action or target test suite",
                        choices=['list', 'result', 'upstream',
                                 'upstream-ttx', 'metadata',
                                 'description', 'upstream-repo'],)
    parser.add_argument('file', nargs="*", help="Test files, can be a list")
    parser.add_argument('--test', help="Test files, can be a list")
    parser.add_argument('--verbose', '-v', action='count',
                        help="Verbosity level", default=1)

    args = parser.parse_args()
    if args.action == 'list':
        tests_report()
        sys.exit()

    if not args.file:
        print("Missing files to test")
        sys.exit(1)

    for x in args.file:
        result = run_set(x, args.action, test_method=args.test)
        failures = map(lambda x: (x._testMethodName, x._err_msg), result.get('failure', []))
        error = map(lambda x: (x._testMethodName, x._err_msg), result.get('error', []))
        success = map(lambda x: (x._testMethodName, 'OK'), result.get('success', []))
        if not bool(failures + error):
            print 'OK'
        else:
            import pprint
예제 #8
0
if __name__ == '__main__':
    description = 'Runs checks or tests on specified fontbakery project'
    parser = argparse.ArgumentParser(description=description)
    parser.add_argument('file', nargs="+", help="Test files, can be a list")
    parser.add_argument('--verbose', '-v', action='count',
                        help="Verbosity level", default=False)

    parser.add_argument('--list-checks', '-l', action='store_true',
                        help="Print available checks", default=False)

    args = parser.parse_args()

    if args.list_checks:
        from bakery_lint.base import tests_report
        print(tests_report('upstream-repo'))
        sys.exit()

    for x in args.file:
        suite = get_suite(x)

        result = run_suite(suite)
        failures = [(testklass._testMethodName, testklass._err_msg)
                     for testklass in result.get('failure', [])]
        error = [(testklass._testMethodName, testklass._err_msg)
                  for testklass in result.get('error', [])]
        success = [(testklass._testMethodName, 'OK')
                    for testklass in result.get('success', [])]

        if not bool(failures + error):
            if args.verbose:
예제 #9
0
                        '-v',
                        action='count',
                        help="Verbosity level",
                        default=False)

    parser.add_argument('--list-checks',
                        '-l',
                        action='store_true',
                        help="Print available checks",
                        default=False)

    args = parser.parse_args()

    if args.list_checks:
        from bakery_lint.base import tests_report
        print(tests_report('description'))
        sys.exit()

    for x in args.file:
        if not os.path.basename(x).startswith('DESCRIPTION.'):
            print('ER: {} is not DESCRIPTION'.format(x), file=sys.stderr)
            continue

        suite = get_suite(x)

        result = run_suite(suite)
        failures = [(testklass._testMethodName, testklass._err_msg)
                    for testklass in result.get('failure', [])]
        error = [(testklass._testMethodName, testklass._err_msg)
                 for testklass in result.get('error', [])]
        success = [(testklass._testMethodName, 'OK')
예제 #10
0
if __name__ == '__main__':
    description = 'Runs checks or tests on specified OTF file(s)'
    parser = argparse.ArgumentParser(description=description)
    parser.add_argument('file', nargs="+", help="Test files, can be a list")
    parser.add_argument('--verbose', '-v', action='count',
                        help="Verbosity level", default=False)

    parser.add_argument('--list-checks', '-l', action='store_true',
                        help="Print available checks", default=False)

    args = parser.parse_args()

    if args.list_checks:
        from bakery_lint.base import tests_report
        print(tests_report('upstream'))
        sys.exit()

    for x in args.file:
        if not x.lower().endswith('.otf'):
            print('ER: {} is not OTF'.format(x), file=sys.stderr)
            continue
        failures = []
        success = []
        error = []

        result = run_set('upstream', test)
        failures += [(testklass._testMethodName, testklass._err_msg)
                     for testklass in result.get('failure', [])]
        error += [(testklass._testMethodName, testklass._err_msg)
                  for testklass in result.get('error', [])]
예제 #11
0
if __name__ == '__main__':
    description = 'Runs checks or tests on specified TTF file(s)'
    parser = argparse.ArgumentParser(description=description)
    parser.add_argument('file', nargs="+", help="Test files, can be a list")
    parser.add_argument('--autofix', '-f', action='store_true',
                        help="Autofix fonts if test has been failed", default=False)
    parser.add_argument('--verbose', '-v', action='count',
                        help="Verbosity level", default=False)
    parser.add_argument('--list-checks', '-l', action='store_true',
                        help="Print available checks", default=False)

    args = parser.parse_args()

    if args.list_checks:
        from bakery_lint.base import tests_report
        print(tests_report('result'))
        sys.exit()

    for x in args.file:

        if not x.lower().endswith('.ttf'):
            print('ER: {} is not TTF'.format(x), file=sys.stderr)
            continue

        suite = get_suite(x, apply_autofix=args.autofix)

        result = run_suite(suite)
        failures = [(testklass._testMethodName, testklass._err_msg)
                     for testklass in result.get('failure', [])]
        error = [(testklass._testMethodName, testklass._err_msg)
                  for testklass in result.get('error', [])]