示例#1
0
文件: prune.py 项目: Sudoka/yuno
def main(argv):
    options, parser = cli.get_cli_args(argv)

    valid_paths = set([test.source.path for test in testing.load_all()])
    listed_passing = testing.Suite.from_file('data/passing.txt')
    listed_failing = testing.Suite.from_file('data/failing.txt')

    valid_passing = _remove_deleted_tests(listed_passing, valid_paths)
    valid_failing = _remove_deleted_tests(listed_failing, valid_paths)

    try:
        print "Removing deleted tests from your history...\n"

        valid_passing[0].save()
        print "Pruned %d bad paths from passing test list." % valid_passing[1]

        valid_failing[0].save()
        print "Pruned %d bad paths from failing test list." % valid_failing[1]

        if options.prune_last or options.prune_all:
            pruned_from_log = _prune_last_run(valid_paths)
            print "\nPruned %d items from the run log." % pruned_from_log

        if options.prune_suites or options.prune_all:
            print "\n",
            for suite, num_removed in _prune_suites(valid_paths):
                print "Pruned %d bad paths from suite %s (%s)." % (
                    num_removed, suite.name, suite.filename
                )

    except errors.YunoError as e:
        print e.for_console()
        _print_interrupt_warning()

    except KeyboardInterrupt:
        _print_interrupt_warning()

    except BaseException:
        _print_interrupt_warning()
        print "\nReason below:" + ('-' * 80)
        raise
示例#2
0
def main(argv):
    args, parser = cli.get_cli_args(argv)

    valid_paths = set([test.source.path for test in testing.load_all()])
    listed_passing = testing.Suite.from_file('data/passing.txt')
    listed_failing = testing.Suite.from_file('data/failing.txt')

    valid_passing = _remove_deleted_tests(listed_passing, valid_paths)
    valid_failing = _remove_deleted_tests(listed_failing, valid_paths)

    try:
        print("Removing deleted tests from your history...\n")

        valid_passing[0].save()
        print("Pruned %d bad paths from passing test list." % valid_passing[1])

        valid_failing[0].save()
        print("Pruned %d bad paths from failing test list." % valid_failing[1])

        if args.prune_last or args.prune_all:
            pruned_from_log = _prune_last_run(valid_paths)
            print("\nPruned %d items from the run log." % pruned_from_log)

        if args.prune_suites or args.prune_all:
            print("")
            for suite, num_removed in _prune_suites(valid_paths):
                print("Pruned %d bad paths from suite %s (%s)." %
                      (num_removed, suite.name, suite.filename))

    except errors.YunoError as e:
        print(e.for_console())
        print(text.PRUNE_INTERRUPTED)

    except KeyboardInterrupt:
        print(text.PRUNE_INTERRUPTED)

    except BaseException:
        print(text.PRUNE_INTERRUPTED)
        print("\nReason below:" + ('-' * 80))
        raise
示例#3
0
def _delete_assembly():
    asm_tests = testing.load_all()

    for test in asm_tests:
        os.remove(posixpath.join(settings.test_folder, test.source.path))
示例#4
0
文件: watch.py 项目: freeqinc/cse131
def _delete_assembly():
    asm_tests = testing.load_all()

    for test in asm_tests:
        os.remove(posixpath.join(settings.test_folder, test.source.path))