Exemplo n.º 1
0
def main():
    for file in os.listdir(this_dir + '/src/'):
        m = re.search('^problem(\d+).py$', file)
        if m:
            num = int(m.group(1))
            name = this_dir + '/out/' 'problem%d.out' % num
            euler_problems.main(shlex.split('-p%d -f%s' % (num, name)))
Exemplo n.º 2
0
def main():
    for file in os.listdir(this_dir + '/src/'):
        m = re.search('^problem(\d+).py$', file)
        if m:
            num = int(m.group(1))
            name = this_dir + '/out/' 'problem%d.out' % num
            euler_problems.main(shlex.split('-p%d -f%s' % (num, name)))
Exemplo n.º 3
0
def main():
    errors = 0
    golden_dir = this_dir + '/test/golden/'
    for gold_file in os.listdir(golden_dir):
        m = re.search('problem(\d+).out', gold_file)
        if m:
            num = int(m.group(1))
            temp_file = this_dir + '/test/out/' 'problem%d.out' % num
            euler_problems.main(shlex.split('-p%d -f%s' % (num, temp_file)))
            full_gold_path = golden_dir + gold_file
            if not filecmp.cmp(full_gold_path, temp_file):
                print('Broken: %s %s' % (full_gold_path, temp_file))
                errors += 1
    return errors
Exemplo n.º 4
0
def main():
    errors = 0
    golden_dir = this_dir + '/test/golden/'
    for gold_file in os.listdir(golden_dir):
        m = re.search('problem(\d+).out', gold_file)
        if m:
            num = int(m.group(1))
            temp_file = this_dir + '/test/out/' 'problem%d.out' % num
            euler_problems.main(shlex.split('-p%d -f%s' % (num, temp_file)))
            full_gold_path = golden_dir + gold_file
            if not filecmp.cmp(full_gold_path, temp_file):
                print('Broken: %s %s' %(full_gold_path, temp_file))
                errors += 1
    return errors