Ejemplo n.º 1
0
def runtest():
    """check error handling"""

    # setup
    with open(Disks.volumes, 'wb') as v:
        for i in range(4 * 1600):
            v.write(bytes(2 * 256))  # Disk.bytes_per_sector plus padding
    shutil.copyfile(Disks.recsgen, Disks.work)

    # file errors
    with open(Files.error, 'w') as ferr:
        xvm('nosuchvol', '1', '-i', stderr=ferr, rc=1)
    if 'Traceback' in content(Files.error, mode='r'):
        error('badfile', 'Bad file not caught')

    with open(Files.error, 'w') as ferr:
        xvm(Disks.volumes, '1', '-a', 'nosuchfile', stderr=ferr, rc=1)
    if 'Traceback' in content(Files.error, mode='r'):
        error('badfile', 'Bad file not caught')

    # bad arguments
    with open(Files.error, 'w') as ferr:
        xvm(Disks.volumes, 'zzz', '-i', stderr=ferr, rc=1)
    if 'Traceback' in content(Files.error, mode='r'):
        error('badarg', 'Bad argument not caught')

    with open(Files.error, 'w') as ferr:
        xvm(Disks.volumes, '1-2-3', '-i', stderr=ferr, rc=1)
    if 'Traceback' in content(Files.error, mode='r'):
        error('badarg', 'Bad argument not caught')

    with open(Files.input, 'wb') as fin:
        fin.write(b'\x99' * 123)
    with open(Files.error, 'w') as ferr:
        xvm(Disks.volumes,
            '0',
            '-a',
            Files.input,
            '-f',
            'foo',
            stderr=ferr,
            rc=1)
    if 'Traceback' in content(Files.error, mode='r'):
        error('badarg', 'Bad argument not caught')

    # cleanup
    os.remove(Files.error)
    os.remove(Files.input)
    os.remove(Disks.work)
    os.remove(Disks.volumes)
Ejemplo n.º 2
0
def gtfo(ircmsg, ircsock):
    try:
        if re.match("^!gtfo$", utils.content(ircmsg)):
	    if utils.sender(ircmsg) in config.MASTERS:
	        ircsock.send("QUIT see you later!\n")
		sys.exit(0) #it should quit itself, not just slack around.
	    else:
	        utils.sendmsg("gtfo to you, dipshit", utils.sender(ircmsg), ircsock)
    except ValueError:
        pass
Ejemplo n.º 3
0
def runtest():
    """check cross-generated output against native reference files"""

    source = os.path.join(Dirs.sources, 'dasource.asm')
    xas(source, '-b', '-R', '-q', '-o', Files.reference, '-E', Files.input)

    # bad command line arguments
    with open(Files.error, 'w') as ferr:
        xda(Files.reference,
            '-a',
            'foo',
            '-f',
            '6666',
            '-o',
            Files.output,
            stderr=ferr,
            rc=1)
    if 'Traceback' in content(Files.error, mode='r'):
        error('badarg', 'Bad argument not caught')

    with open(Files.error, 'w') as ferr:
        xda(Files.reference,
            '-a',
            'fff',
            '-f',
            '600x',
            '-o',
            Files.output,
            stderr=ferr,
            rc=1)
    if 'Traceback' in content(Files.error, mode='r'):
        error('badarg', 'Bad argument not caught')

    with open(Files.error, 'w') as ferr:
        xda(Files.reference,
            '-a',
            '1000',
            '-f',
            '1000',
            '-e',
            '1100',
            '-o',
            Files.output,
            stderr=ferr,
            rc=1)
    if 'Traceback' in content(Files.error, mode='r'):
        error('badarg', 'Bad argument not caught')

    with open(Files.error, 'w') as ferr:
        xda(Files.reference,
            '-a',
            '1000',
            '-f',
            '1000',
            '-e',
            '1100-1-1',
            '-o',
            Files.output,
            stderr=ferr,
            rc=1)
    if 'Traceback' in content(Files.error, mode='r'):
        error('badarg', 'Bad argument not caught')

    # skip all bytes
    with open(Files.error, 'w') as ferr:
        xda(Files.reference,
            '-k',
            '>ffffffff',
            '-a',
            '1234',
            '-f',
            '1000',
            '-o',
            Files.output,
            stderr=ferr,
            rc=0)
    if content(Files.output).strip() != b'aorg >1234':
        error('skipall', 'still unskipped content left')

    # missing files
    with open(Files.error, 'w') as ferr:
        xda('asm/nosuchfile',
            '-a',
            '6000',
            '-f',
            '6666',
            '-o',
            Files.output,
            stderr=ferr,
            rc=1)
    if 'Traceback' in content(Files.error, mode='r'):
        error('badfile', 'Bad input file not caught')

    with open(Files.error, 'w') as ferr:
        xda(Files.reference,
            '-a',
            '6000',
            '-f',
            '6016',
            '-S',
            'nosuchfile',
            '-o',
            Files.output,
            stderr=ferr,
            rc=1)
    if 'Traceback' in content(Files.error, mode='r'):
        error('badfile', 'Bad input file not caught')

    # Cleanup
    os.remove(Files.input)
    os.remove(Files.error)
    os.remove(Files.reference)
    try:
        os.remove(Files.output)
    except FileNotFoundError:
        pass
Ejemplo n.º 4
0
import utils
import sys

#Check for the number of arguments and if command is manage.py
if len(sys.argv) > 1 and sys.argv[0] == 'manage.py':
    command = sys.argv[1]
    if command == "build":
        #runs the old commands
        utils.main()
        utils.content()
        utils.blog()
        utils.blog_content()
        print('Succesful', command)
    elif command == "new":
        # create new page new_content_page.html
        utils.new()
        print('New content page created')
    else:
        print("Please specify ’build’ or ’new’")

    #If User input has only one argument or argument is not equal to 'manage.py'
else:
    print('''
	Usage:
	Rebuild site:		python manage.py build
	Create new page:	python manage.py new
		''')
Ejemplo n.º 5
0
def runtest():
    """check command line interface"""

    # input and output files
    source = os.path.join(Dirs.sources, 'ashellon.asm')
    with open(Files.output, 'wb') as f:
        xas(source, '-R', '-o', '-', stdout=f)
    xdm(Disks.asmsrcs, '-e', 'ASHELLO-O', '-q', '-o', Files.reference)
    check_obj_code_eq(Files.output, Files.reference)

    xas(source, '-R', '-o', Dirs.tmp)  # -o <dir>
    if not os.path.isfile(os.path.join(Dirs.tmp, 'ashellon.obj')):
        error('output', '-o <dir> failed')

    with open(Files.output, 'wb') as f:
        xas(source,
            '-R',
            '-i',
            '-D',
            'VSBW=>210C',
            'VMBW=>2110',
            'VWTR=>211C',
            'KSCAN=>2108',
            '-o',
            '-',
            stdout=f)
    xdm(Disks.asmsrcs, '-e', 'ASHELLO-I', '-o', Files.reference)
    check_image_files_eq(Files.output, Files.reference)

    with open(Files.output, 'w') as f:
        xas(source, '-R', '-q', '-o', Files.output, '-L', '-', stdout=f)
    xdm(Disks.asmsrcs, '-e', 'ASHELLO-L', '-o', Files.reference)
    check_list_files_eq(Files.output, Files.reference)

    source = os.path.join(Dirs.sources, 'nonexisting')
    with open(Files.error, 'w') as ferr:
        xas(source, '-i', '-R', '-o', Files.output, stderr=ferr, rc=1)
    with open(Files.error, 'r') as ferr:
        errs = ferr.readlines()
    if len(errs) != 1 or 'File not found' not in errs[
            0] or 'nonexisting' not in errs[0]:
        error('File error', 'Incorrect file error message')

    # include path
    source = os.path.join(Dirs.sources, 'ascopyi.asm')
    incls = os.path.join(Dirs.sources, 'test') + ',' + os.path.join(
        Dirs.sources, 'test', 'test')
    xas(source, '-i', '-I', incls, '-o', Files.output)
    with open(Files.output, 'rb') as f:
        data = f.read()
    if len(data) != 6 + 20:
        error('Include paths', 'Incorrect image length')

    # command-line definitions
    source = os.path.join(Dirs.sources, 'asdef.asm')
    xas(source, '-b', '-D', 's1=1', 's3=3', 's2=4', '-o', Files.output)
    if content(Files.output) != b'\x01\x03':
        error('-D', 'Content mismatch')
    xas(source, '-b', '-D', 's1=2,s2=2,s3=3', '-o', Files.output)
    if content(Files.output) != b'\x02\x03':
        error('-D', 'Content mismatch')

    # rebase -a
    source = os.path.join(Dirs.sources, 'asrebase.asm')
    xas(source, '-b', '-a', '>2000', '-o', Files.output)
    ref = os.path.join(Dirs.sources, 'asrebasen.asm')
    xas(ref, '-b', '-o', Files.reference)
    check_binary_files_eq('rebase', Files.output, Files.reference)

    # various parameter combinations
    source = os.path.join(Dirs.sources, 'asxbank1.asm')
    remove([Files.reference])
    xas(source, '-b', '-q', '-o', Files.output, '-L', Files.reference)
    check_exists([Files.reference])

    # text data output
    source = os.path.join(Dirs.sources, 'ascart.asm')
    xas(source, '-b', '-R', '-o', Files.reference)
    xas(source, '-t', 'a2', '-R', '-o', Files.output)
    check_bin_text_equal_bytes(Files.output, Files.reference)

    source = os.path.join(Dirs.sources, 'asmtext.asm')
    xas(source, '-t', 'a2', '-R', '-o', Files.output)
    dat = content(Files.output, mode='r')
    if (not 'aorg >1000' in dat or 'aorg >1010' in dat or 'data' in dat
            or not 'byte' in dat or '0x' in dat or not '>' in dat):
        error('dat', 'Invalid .dat file contents')

    # symbols
    source = os.path.join(Dirs.sources, 'assyms.asm')
    xas(source, '-b', '-R', '-o', Files.reference, '-E', Files.output)
    check_symbols(
        Files.output,
        (
            ('VDPWA', 'SCAN'),  # referencecs
            (('START', '>0000'), ('S1', '>0001'), ('S2', '>0018'))))  # symbols

    # disable warnings
    source = os.path.join(Dirs.sources, 'aswarn.asm')
    with open(Files.error, 'w') as ferr:
        xas(source, '-b', '-R', '-q', '-o', Files.output, stderr=ferr, rc=0)
    if content_len(Files.error) > 0:
        error('warn', 'warnings, even though disabled')

    # linker
    source1 = os.path.join(Dirs.sources, 'aslink0a.asm')
    source2 = os.path.join(Dirs.sources, 'aslink0b.asm')
    xas(source1, '-q', '-o', Files.input)
    xas(source2, '-q', '-o', Files.output)
    with open(Files.error, "w") as ferr:
        xas('-l',
            Files.input,
            '-ll',
            Files.output,
            '-o',
            Files.reference,
            rc=2,
            stderr=ferr)  # mutually exclusive

    # cleanup
    os.remove(Files.output)
    os.remove(Files.reference)
    os.remove(Files.error)
Ejemplo n.º 6
0
def runtest():
    """check command line interface"""

    # input and output files
    source = os.path.join(Dirs.sources, "ashello.asm")
    with open(Files.output, "wb") as f:
        xas(source, "-R", "-o", "-", stdout=f)
    xdm(Disks.asmsrcs, "-e", "ASHELLO-O", "-o", Files.reference)
    check_obj_code_eq(Files.output, Files.reference)

    with open(Files.output, "wb") as f:
        xas(source, "-R", "-i", "-o", "-", stdout=f)
    xdm(Disks.asmsrcs, "-e", "ASHELLO-I", "-o", Files.reference)
    check_image_files_eq(Files.output, Files.reference)

    with open(Files.output, "w") as f:
        xas(source, "-R", "-o", Files.output, "-L", "-", stdout=f)
    xdm(Disks.asmsrcs, "-e", "ASHELLO-L", "-o", Files.reference)
    check_list_files_eq(Files.output, Files.reference)

    source = os.path.join(Dirs.sources, "nonexisting")
    with open(Files.error, "w") as ferr:
        xas(source, "-i", "-R", "-o", Files.output, stderr=ferr, rc=1)
    with open(Files.error, "r") as ferr:
        errs = ferr.readlines()
    if len(errs) != 1 or errs[0][:10] != "File error":
        error("File error", "Incorrect file error message")

    # include path
    source = os.path.join(Dirs.sources, "ascopyi.asm")
    incls = os.path.join(Dirs.sources, "test") + "," + \
        os.path.join(Dirs.sources, "test", "test")
    xas(source, "-i", "-I", incls, "-o", Files.output)
    with open(Files.output, "rb") as f:
        data = f.read()
    if len(data[6:]) != 20:
        error("Include paths", "Incorrect image length")

    # command-line definitions
    source = os.path.join(Dirs.sources, "asdef.asm")
    xas(source, "-b", "-D", "s1=1", "s3=3", "s2=4", "-o", Files.output)
    assert content(Files.output) == "\x01\x03"
    xas(source, "-b", "-D", "s1=2,s2=2,s3=3", "-o", Files.output)
    assert content(Files.output) == "\x02\x03"

    # various parameter combinations
    source = os.path.join(Dirs.sources, "asxbank1.asm")
    remove([Files.reference])
    xas(source, "-b", "-o", Files.output, "-L", Files.reference)
    check_exists([Files.reference])

    # text data output
    source = os.path.join(Dirs.sources, "ascart.asm")
    xas(source, "-b", "-R", "-o", Files.reference)
    xas(source, "-t", "a2", "-R", "-o", Files.output)
    check_bin_text_equal(Files.output, Files.reference)

    source = os.path.join(Dirs.sources, "asmtext.asm")
    xas(source, "-t", "a2", "-R", "-o", Files.output)
    check_instructions(Files.output,
                       [";aorg>1000", "byte", ";aorg>2000", "byte"])

    # symbols
    source = os.path.join(Dirs.sources, "assyms.asm")
    xas(source, "-b", "-R", "-o", Files.reference, "-E", Files.output)
    check_symbols(Files.output, (("START", ">0000"), ("S1", ">0001"),
                                 ("S2", ">0018"), ("VDPWA", ">8C02")))

    # disable warnings
    source = os.path.join(Dirs.sources, "aswarn.asm")
    with open(Files.error, "w") as ferr:
        xas(source, "-b", "-R", "-w", "-o", Files.output, stderr=ferr, rc=0)
    if content_len(Files.error) > 0:
        error("warn", "warnings, even though disabled")

    # cleanup
    os.remove(Files.output)
    os.remove(Files.reference)
    os.remove(Files.error)
Ejemplo n.º 7
0
def runtest():
    """check xdt99 extensions"""

    # xdt99 extensions
    source = os.path.join(Dirs.sources, 'asxext.asm')
    xas(source, '-R', '-q', '-o', Files.output)
    xdm(Disks.asmsrcs, '-e', 'ASXEXT0-O', '-o', Files.reference)
    check_obj_code_eq(Files.output, Files.reference)
    xas(source, '-R', '-D', 'sym2', '-q', '-o', Files.output)
    xdm(Disks.asmsrcs, '-e', 'ASXEXT1-O', '-o', Files.reference)
    check_obj_code_eq(Files.output, Files.reference)
    xas(source, '-R', '-D', 'sym2=2', 'sym3=2', '-q', '-o', Files.output)
    xdm(Disks.asmsrcs, '-e', 'ASXEXT2-O', '-o', Files.reference)
    check_obj_code_eq(Files.output, Files.reference)
    xas(source, '-R', '-D', 'sym2=2,sym3=2', '-q', '-o', Files.output)
    xdm(Disks.asmsrcs, '-e', 'ASXEXT2-O', '-o', Files.reference)
    check_obj_code_eq(Files.output, Files.reference)

    # some CLI options
    source = os.path.join(Dirs.sources, 'ascart.asm')
    xas(source, '--embed', '-R', '-o', Files.output)

    # misc new features
    for infile, opts, reffile in [('asxnew.asm', ['-18'], 'ASXNEW-O'),
                                  ('asmacs.asm', [], 'ASMACS-O')]:
        source = os.path.join(Dirs.sources, infile)
        xas(source, *opts, '-q', '-o', Files.output)
        xdm(Disks.asmsrcs, '-e', reffile, '-o', Files.reference)
        check_obj_code_eq(Files.output, Files.reference)

    # macro with text argument in listing
    source = os.path.join(Dirs.sources, 'asmactxt.asm')
    xas(source, 'vmbw.a99', '-R', '-b', '-o', Files.input, '-L', Files.output)
    if "'0'" in content_lines(Files.output):
        error('macro/listing', 'Macro arguments not escaped in listing')

    # SAVE directive
    source = os.path.join(Dirs.sources, 'asxsave.asm')
    xas(source, '-b', '--base', '0xb000', '-q', '-o', Files.output)
    for i, a in enumerate(['_b000', '_b020', '_b030', '_b080']):
        ref = os.path.join(Dirs.refs, f'asxsave_{i}.bin')
        check_binary_files_eq('SAVE', Files.output + a, ref)

    xas(source, '-t', 'a2', '-a', '0xb000', '-q', '-o', Files.output)
    for i, a in enumerate(['_b000', '_b020', '_b030', '_b080']):
        ref = os.path.join(Dirs.refs, f'asxsave_{i}.bin')
        check_dat_file_eq(Files.output + a, ref)

    source = os.path.join(Dirs.sources, 'asxsavee.asm')
    xas(source, '-b', '-a', '0x6000', '-q', '-o', Files.output)
    if content(Files.output) != b'\x22\x22\x22\x22':
        error('SAVE', 'Bad file contents')

    source = os.path.join(Dirs.sources, 'asxsaveo.asm')
    xas(source, '-b', '-o', Files.output)
    ref2 = os.path.join(Dirs.sources, 'asxsaveo2.asm')
    ref6 = os.path.join(Dirs.sources, 'asxsaveo6.asm')
    xas(ref2, '-b', '-o', Files.reference)
    check_binary_files_eq('SAVE', Files.output + '_2000', Files.reference)
    xas(ref6, '-b', '-o', Files.reference)
    check_binary_files_eq('SAVE', Files.output + '_6000', Files.reference)

    # remove front/back padding from saved binary
    source = os.path.join(Dirs.sources, 'asxsavem.asm')
    # this padding could be avoided if saves would *enable* splitting of segments
    xas(source, '-b', '-o', Files.output)
    ref = os.path.join(Dirs.sources, 'asxsavem0.asm')
    xas(ref, '-b', '-o', Files.reference)
    check_binary_files_eq('SAVE', Files.output, Files.reference)

    # bank switching: obsolete AORG addr, bank
    source = os.path.join(Dirs.sources, 'asxbank1.asm')
    xas(source, '-b', '-a', '>6030', '-q', '-o', Files.output)
    save2s = [Files.output + '_b' + str(ext) for ext in range(3)]
    check_concat_eq(save2s, os.path.join(Dirs.refs, 'save2'))

    source = os.path.join(Dirs.sources, 'asxbank2.asm')
    xas(source, '-b', '-q', '-o', Files.output)
    for i, a in enumerate([
            '_c000_b0', '_d000_b0', '_e000_b0', '_c000_b1', '_d000_b1',
            '_e000_b1'
    ]):
        xas(os.path.join(Dirs.sources, 'asxbank2' + a + '.asm'), '-b', '-q',
            '-o', Files.reference)
        check_binary_files_eq('BANK+SAVE', Files.output + a, Files.reference)

    source = os.path.join(Dirs.sources, 'asxsegm.asm')
    xas(source, '-i', '-q', '-o', Files.output)
    check_file_sizes([(Files.outputff[i], size)
                      for i, size in enumerate([26, 20, 14])])
    for i, val in enumerate([0x10, 0x20, 0x30]):
        check_image_values(Files.outputff[i], val)

    # BANK directive
    source = os.path.join(Dirs.sources, 'asdbank.asm')
    xas(source, '-b', '-R', '-o', Files.output)
    ref1 = os.path.join(Dirs.sources, 'asdbank_b0.asm')
    ref2 = os.path.join(Dirs.sources, 'asdbank_b1.asm')
    xas(ref1, '-b', '-R', '-o', Files.reference)
    check_binary_files_eq('BANK', Files.output + '_b0', Files.reference)
    xas(ref2, '-b', '-R', '-o', Files.reference)
    check_binary_files_eq('BANK', Files.output + '_b1', Files.reference)

    # cross-bank access
    source = os.path.join(Dirs.sources, 'asxbank.asm')
    with open(Files.error, 'w') as ferr:
        xas(source, '-b', '-R', '-o', Files.output, stderr=ferr,
            rc=0)  # no error

    source = os.path.join(Dirs.sources, 'asnxbank.asm')
    with open(Files.error, 'w') as ferr:
        xas(source, '-b', '-R', '-o', Files.output, stderr=ferr,
            rc=1)  # with errors

    # sections shared across banks
    source = os.path.join(Dirs.sources, 'asshbank.asm')
    with open(Files.error, 'w') as ferr:
        xas(source, '-b', '-R', '-o', Files.output, stderr=ferr,
            rc=1)  # with errors
    act_errors = read_stderr(Files.error)
    exp_errors = get_source_markers(source, r';ERROR(:....)?')
    check_errors(exp_errors, act_errors)

    source = os.path.join(Dirs.sources, 'asshbankx.asm')
    with open(Files.error, 'w') as ferr:
        xas(source, '-b', '-R', '-o', Files.output, stderr=ferr,
            rc=0)  # no error

    # data output (-t)
    source = os.path.join(Dirs.sources, 'ashexdat.asm')
    xas(source, '-t', 'a2', '-R', '-o', Files.output)
    xas(source, '-b', '-R', '-o', Files.reference)
    check_numeric_eq(Files.output, Files.reference)

    source = os.path.join(Dirs.sources, 'asxtext.asm')
    xas(source, '-t', 'a2', '-o', Files.output + '1')
    xas(source, '-t', 'c4', '-o', Files.output + '2')
    xas(source, '-t', 'b', '-o', Files.output + '3')
    xas(source, '-t', 'a4', '-o', Files.output + '4')
    xas(source, '-t', 'c', '-o', Files.output + '5')
    save5s = [Files.output + ext for ext in ['1', '2', '3', '4', '5']]
    check_lines_eq(save5s, os.path.join(Dirs.refs, 'asxtext'))

    # auto-generated constants (b#, w#)
    source = os.path.join(Dirs.sources, 'asauto.asm')
    xas(source, '-R', '-o', Files.output)
    ref = os.path.join(Dirs.sources, 'asauton.asm')
    xas(ref, '-R', '-o', Files.reference)
    check_obj_code_eq(Files.output, Files.reference)

    xas(source, '-R', '-a', '>2000', '-o', Files.output)
    xas(ref, '-R', '-a', '>2000', '-o', Files.reference)
    check_obj_code_eq(Files.output, Files.reference)  # relocated

    xas(source, '-b', '-R', '-o', Files.output)
    xas(ref, '-b', '-R', '-o', Files.reference)
    check_binary_files_eq('auto-const', Files.output,
                          Files.reference)  # as binary

    # size modifier (s#)
    source = os.path.join(Dirs.sources, 'assmod.asm')
    with open(Files.error, 'w') as ferr:
        xas(source, '-b', '-R', '-o', Files.output, stderr=ferr, rc=0)
    ref = os.path.join(Dirs.sources, 'assmodn.asm')
    xas(ref, '-b', '-R', '-q', '-o', Files.reference)
    check_binary_files_eq('s#', Files.output, Files.reference)

    source = os.path.join(Dirs.sources, 'assmode.asm')
    with open(Files.error, 'w') as ferr:
        xas(source, '-b', '-R', '-o', Files.output, stderr=ferr, rc=1)
    act_errors = read_stderr(Files.error)
    exp_errors = get_source_markers(source, tag=r';ERROR')
    check_errors(exp_errors, act_errors)

    # floating-point numbers
    source = os.path.join(Dirs.sources, 'asfloat.asm')
    xas(source, '-b', '-o', Files.output)
    ref = os.path.join(Dirs.refs, 'asfloat.ref')
    check_binary_files_eq('float', Files.output, ref)

    # 9995 and F18A
    source1 = os.path.join(Dirs.sources, 'as9995.asm')
    xas(source1, '-R', '-b', '-5', '-o', Files.output)
    ref = os.path.join(Dirs.refs, 'as9995.ref')
    check_binary_files_eq('9995', Files.output, ref)

    source2 = os.path.join(Dirs.sources, 'asf18a.asm')
    xas(source2, '-R', '-b', '--f18a', '-o', Files.output)
    ref = os.path.join(Dirs.refs, 'asf18a.ref')
    check_binary_files_eq('f18a', Files.output, ref)

    with open(source1, 'r') as f1, open(source2, 'r') as f2:
        lines1 = f1.readlines()
        lines2 = f2.readlines()
        with open(Files.input, 'w') as fout:
            fout.writelines(lines1 + lines2)
    xas(Files.input, '-R', '-5', '-18', '-o', Files.output, rc=0)

    # cleanup
    for fn in glob.glob("tmp/outpu*"):
        os.remove(fn)
    os.remove(Files.input)
    os.remove(Files.reference)