Changeset cb7caf8


Ignore:
Timestamp:
May 30, 2018, 4:37:26 PM (4 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, with_gc
Children:
d15a45d
Parents:
d4afaac (diff), c24ef9d (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:/u/cforall/software/cfa/cfa-cc

Location:
src/tests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/tests/pybin/tools.py

    rd4afaac rcb7caf8  
    8383        return sh(cmd)
    8484
     85def which(program):
     86    import os
     87    def is_exe(fpath):
     88        return os.path.isfile(fpath) and os.access(fpath, os.X_OK)
     89
     90    fpath, fname = os.path.split(program)
     91    if fpath:
     92        if is_exe(program):
     93            return program
     94    else:
     95        for path in os.environ["PATH"].split(os.pathsep):
     96            exe_file = os.path.join(path, program)
     97            if is_exe(exe_file):
     98                return exe_file
     99
     100    return None
    85101################################################################################
    86102#               file handling
     
    219235        return False
    220236
     237def fancy_print(text):
     238        column = which('column')
     239        if column:
     240                cmd = "%s 2> /dev/null" % column
     241                print(cmd)
     242                proc = Popen(cmd, stdin=PIPE, stderr=None, shell=True)
     243                proc.communicate(input=text)
     244        else:
     245                print(text)
    221246
    222247settings.set_machine_default( getMachineType )
  • src/tests/test.py

    rd4afaac rcb7caf8  
    277277        elif options.list :
    278278                print("Listing for %s:%s"% (settings.arch.string, settings.debug.string))
    279                 print("\n".join(map(lambda t: "%s" % (t.toString()), tests)))
     279                fancy_print("\n".join(map(lambda t: "%s" % (t.toString()), tests)))
    280280
    281281        else :
Note: See TracChangeset for help on using the changeset viewer.