Changeset 330d933 for tests/pybin


Ignore:
Timestamp:
Aug 25, 2019, 8:48:51 AM (6 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
2aab69b, 5a43ab8
Parents:
f9bf142 (diff), bbb1b35 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

Location:
tests/pybin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tests/pybin/settings.py

    rf9bf142 r330d933  
    44from . import tools
    55
     6global original_path
     7
    68try :
     9        original_path = os.getcwd()
    710        testpath = os.path.dirname(os.path.abspath(os.path.join(os.getcwd(), sys.argv[0])))
    811        sys.path.append(testpath)
     
    1922class Architecture:
    2023        KnownArchitectures = {
    21                 'x64'                   : 'x64',
    22                 'x86-64'                : 'x64',
    23                 'x86_64'                : 'x64',
    24                 'aarch64'               : 'x64',
    25                 'x86'                   : 'x86',
     24                'x64'           : 'x64',
     25                'x86-64'        : 'x64',
     26                'x86_64'        : 'x64',
     27                'x86'           : 'x86',
     28                'aarch64'       : 'arm',
    2629                'i386'          : 'x86',
    2730                'i486'          : 'x86',
    2831                'i686'          : 'x86',
    2932                'Intel 80386'   : 'x86',
    30                 'arm'                   : 'arm',
    31                 'ARM'                   : 'arm',
     33                'arm'           : 'arm',
     34                'ARM'           : 'arm',
    3235        }
    3336
     
    113116        global timeout
    114117        global output_width
     118        global archive
    115119
    116120        dry_run      = options.dry_run
     
    122126        timeout      = Timeouts(options.timeout, options.global_timeout)
    123127        output_width = 24
     128        archive      = os.path.abspath(os.path.join(original_path, options.archive_errors)) if options.archive_errors else None
    124129
    125130
  • tests/pybin/tools.py

    rf9bf142 r330d933  
    22import argparse
    33import contextlib
     4import datetime
    45import fileinput
    56import multiprocessing
     
    273274################################################################################
    274275
     276def pretty_now():
     277        ts = time.time()
     278        print(ts, file=sys.stderr)
     279        return datetime.datetime.fromtimestamp(ts).strftime('%Y-%m-%d_%H:%M:%S')
     280
    275281# check if arguments is yes or no
    276282def yes_no(string):
     
    304310        return sh('gdb', '-n', path, core, '-batch', '-x', cmd, output=subprocess.PIPE)
    305311
     312def core_archive(dst, name, exe):
     313        # Get the files to copy
     314        core = os.path.join(os.getcwd(), "core" )
     315
     316        # Uncomment if we want timestamps on coredumps
     317        # dst  = os.path.join(dst, "%s_%s" % (name, pretty_now()))
     318
     319        # make a directory for this test
     320        mkdir(os.path.join(dst, "dir"))
     321
     322        # moves the files
     323        mv( core, os.path.join(dst, "core" ) )
     324        mv( exe , os.path.join(dst, name   ) )
     325
     326        # return explanatory test
     327        return "Archiving %s (executable and core) to %s" % (os.path.relpath(exe, settings.BUILDDIR), os.path.relpath(dst, settings.original_path))
     328
    306329class Timed:
    307330    def __enter__(self):
Note: See TracChangeset for help on using the changeset viewer.