Пример #1
0
from difflib import unified_diff

from LedgerHarness import LedgerHarness

args = sys.argv
jobs = 1
match = re.match('-j([0-9]+)?', args[1])
if match:
    args = [args[0]] + args[2:]
    if match.group(1):
        jobs = int(match.group(1))
if jobs == 1:
    multiproc = False

harness = LedgerHarness(args)
tests = args[3]

if not os.path.isdir(tests) and not os.path.isfile(tests):
    sys.stderr.write("'%s' is not a directory or file (cwd %s)" %
                     (tests, os.getcwd()))
    sys.exit(1)


class RegressFile(object):
    def __init__(self, filename):
        self.filename = filename
        self.fd = open(self.filename, encoding='utf-8')

    def transform_line(self, line):
        line = line.replace('$sourcepath', harness.sourcepath)
Пример #2
0
from string import join
from difflib import unified_diff

from LedgerHarness import LedgerHarness

args = sys.argv
jobs = 1
match = re.match('-j([0-9]+)?', args[1])
if match:
    args = [args[0]] + args[2:]
    if match.group(1):
        jobs = int(match.group(1))
if jobs == 1:
    multiproc = False

harness = LedgerHarness(args)
tests   = args[3]

if not os.path.isdir(tests) and not os.path.isfile(tests):
    sys.exit(1)

class RegressFile(object):
    def __init__(self, filename):
        self.filename = filename
        self.fd = open(self.filename)

    def transform_line(self, line):
        line = re.sub('\$sourcepath', harness.sourcepath, line)
        return line

    def read_test(self):
Пример #3
0
#!/usr/bin/python

from __future__ import print_function

# This script confirms both that the register report "adds up", and that its
# final balance is the same as what the balance report shows.

import sys
import os
import re

from LedgerHarness import LedgerHarness

harness = LedgerHarness(sys.argv)
tests   = sys.argv[3]

if not os.path.isdir(tests) and not os.path.isfile(tests):
    sys.stderr.write("'%s' is not a directory or file (cwd %s)" %
                     (tests, os.getcwd()))
    sys.exit(1)

commands = [
    "-f '$tests/standard.dat' -O 0ecbb1b15e2cf3e515cc0f8533e5bb0fb2326728",
    "-f '$tests/standard.dat' -B c56a21d23a6535184e7152ee138c28974f14280c",
    "-f '$tests/standard.dat' -V c56a21d23a6535184e7152ee138c28974f14280c",
    "-f '$tests/standard.dat' -G c56a21d23a6535184e7152ee138c28974f14280c",
    "-f '$tests/standard.dat' -B c0226fafdf9e6711ac9121cf263e2d50791859cb",
    "-f '$tests/standard.dat' -V c0226fafdf9e6711ac9121cf263e2d50791859cb",
    "-f '$tests/standard.dat' -G c0226fafdf9e6711ac9121cf263e2d50791859cb"
]
Пример #4
0
#!/usr/bin/python

# This script confirms both that the register report "adds up", and that its
# final balance is the same as what the balance report shows.

import sys
#import re

from difflib import ndiff

from LedgerHarness import LedgerHarness

harness = LedgerHarness(sys.argv)

#def normalize(line):
#    match = re.match("((\s*)([A-Za-z]+)?(\s*)([-0-9.]+)(\s*)([A-Za-z]+)?)(  (.+))?$", line)
#    if match:
#        if match.group(3):
#            prefix = match.group(3) + " " + match.group(5)
#            if match.group(8):
#                return prefix + match.group(8)
#            return prefix
#        elif match.group(7):
#            prefix = match.group(7) + " " + match.group(5)
#            if match.group(8):
#                return prefix + match.group(8)
#            return prefix
#    return line

def generation_test(seed):
    p_gen = harness.run('$ledger --seed=%d generate' % seed)
Пример #5
0
except:
    pass

args = sys.argv
jobs = 1
match = re.match('-j([0-9]+)?', args[1])
if match:
    args = [args[0]] + args[2:]
    if match.group(1):
        jobs = int(match.group(1))
if jobs == 1:
    multiproc = False

from LedgerHarness import LedgerHarness

harness = LedgerHarness(args)

#def normalize(line):
#    match = re.match("((\s*)([A-Za-z]+)?(\s*)([-0-9.]+)(\s*)([A-Za-z]+)?)(  (.+))?$", line)
#    if match:
#        if match.group(3):
#            prefix = match.group(3) + " " + match.group(5)
#            if match.group(8):
#                return prefix + match.group(8)
#            return prefix
#        elif match.group(7):
#            prefix = match.group(7) + " " + match.group(5)
#            if match.group(8):
#                return prefix + match.group(8)
#            return prefix
#    return line
Пример #6
0
except:
    pass

args = sys.argv
jobs = 1
match = re.match('-j([0-9]+)?', args[1])
if match:
    args = [args[0]] + args[2:]
    if match.group(1):
        jobs = int(match.group(1))
if jobs == 1:
    multiproc = False

from LedgerHarness import LedgerHarness

harness = LedgerHarness(args)

#def normalize(line):
#    match = re.match("((\s*)([A-Za-z]+)?(\s*)([-0-9.]+)(\s*)([A-Za-z]+)?)(  (.+))?$", line)
#    if match:
#        if match.group(3):
#            prefix = match.group(3) + " " + match.group(5)
#            if match.group(8):
#                return prefix + match.group(8)
#            return prefix
#        elif match.group(7):
#            prefix = match.group(7) + " " + match.group(5)
#            if match.group(8):
#                return prefix + match.group(8)
#            return prefix
#    return line
Пример #7
0
#!/usr/bin/python

# This script confirms both that the register report "adds up", and that its
# final balance is the same as what the balance report shows.

import sys
import os
import re

from LedgerHarness import LedgerHarness

harness = LedgerHarness(sys.argv)
tests = sys.argv[3]

if not os.path.isdir(tests) and not os.path.isfile(tests):
    sys.stderr.write("'%s' is not a directory or file (cwd %s)" %
                     (tests, os.getcwd()))
    sys.exit(1)

commands = [
    "-f '$tests/standard.dat' -O 0ecbb1b15e2cf3e515cc0f8533e5bb0fb2326728",
    "-f '$tests/standard.dat' -B c56a21d23a6535184e7152ee138c28974f14280c",
    "-f '$tests/standard.dat' -V c56a21d23a6535184e7152ee138c28974f14280c",
    "-f '$tests/standard.dat' -G c56a21d23a6535184e7152ee138c28974f14280c",
    "-f '$tests/standard.dat' -B c0226fafdf9e6711ac9121cf263e2d50791859cb",
    "-f '$tests/standard.dat' -V c0226fafdf9e6711ac9121cf263e2d50791859cb",
    "-f '$tests/standard.dat' -G c0226fafdf9e6711ac9121cf263e2d50791859cb"
]


def clean(num):
Пример #8
0
from string import join
from difflib import unified_diff

from LedgerHarness import LedgerHarness

args = sys.argv
jobs = 1
match = re.match('-j([0-9]+)?', args[1])
if match:
    args = [args[0]] + args[2:]
    if match.group(1):
        jobs = int(match.group(1))
if jobs == 1:
    multiproc = False

harness = LedgerHarness(args)
tests   = args[3]

if not os.path.isdir(tests) and not os.path.isfile(tests):
    sys.exit(1)

class RegressFile(object):
    def __init__(self, filename):
        self.filename = filename
        self.fd = open(self.filename)

    def is_directive(self, line):
        return line == "<<<\n" or \
               line == ">>>\n" or \
               line == ">>>1\n" or \
               line == ">>>2\n" or \