diff options
| author | Dave Parks <davep@lindenlab.com> | 2012-06-28 13:50:35 -0500 | 
|---|---|---|
| committer | Dave Parks <davep@lindenlab.com> | 2012-06-28 13:50:35 -0500 | 
| commit | db5d1b851a0d808dc1e8b0896fad734c2c54a03f (patch) | |
| tree | ebe50ddb5e1aa700d54f50bbc1ab4b435462b85e /indra/cmake | |
| parent | 1d8f117069945499ac297ef13eb6a916a2b96d72 (diff) | |
| parent | ed72fd0ae98671f1cfce3c975b93e1f760fc40f0 (diff) | |
merge
Diffstat (limited to 'indra/cmake')
| -rw-r--r-- | indra/cmake/LLTestCommand.cmake | 3 | ||||
| -rw-r--r-- | indra/cmake/run_build_test.py | 30 | 
2 files changed, 32 insertions, 1 deletions
| diff --git a/indra/cmake/LLTestCommand.cmake b/indra/cmake/LLTestCommand.cmake index b5a0580a90..f75c23a5de 100644 --- a/indra/cmake/LLTestCommand.cmake +++ b/indra/cmake/LLTestCommand.cmake @@ -9,6 +9,9 @@ MACRO(LL_TEST_COMMAND OUTVAR LD_LIBRARY_PATH)    FOREACH(dir ${LD_LIBRARY_PATH})      LIST(APPEND value "-l${dir}")    ENDFOREACH(dir) +  # Enough different tests want to be able to find CMake's PYTHON_EXECUTABLE +  # that we should just pop it into the environment for everybody. +  LIST(APPEND value "-DPYTHON=${PYTHON_EXECUTABLE}")    LIST(APPEND value ${ARGN})    SET(${OUTVAR} ${value})  ##IF(LL_TEST_VERBOSE) diff --git a/indra/cmake/run_build_test.py b/indra/cmake/run_build_test.py index ce2d1e0386..a2ef61c8fd 100644 --- a/indra/cmake/run_build_test.py +++ b/indra/cmake/run_build_test.py @@ -46,6 +46,7 @@ $/LicenseInfo$  import os  import sys +import signal  import subprocess  def main(command, libpath=[], vars={}): @@ -113,6 +114,33 @@ def main(command, libpath=[], vars={}):      sys.stdout.flush()      return subprocess.call(command) +# swiped from vita, sigh, seems like a Bad Idea to introduce dependency +def translate_rc(rc): +    """ +    Accept an rc encoded as for subprocess.Popen.returncode: +    None means still running +    int >= 0 means terminated voluntarily with specified rc +    int <  0 means terminated by signal (-rc) + +    Return a string explaining the outcome. In case of a signal, try to +    name the corresponding symbol from the 'signal' module. +    """ +    if rc is None: +        return "still running" +     +    if rc >= 0: +        return "terminated with rc %s" % rc + +    # Negative rc means the child was terminated by signal -rc. +    rc = -rc +    for attr in dir(signal): +        if attr.startswith('SIG') and getattr(signal, attr) == rc: +            strc = attr +            break +    else: +        strc = str(rc) +    return "terminated by signal %s" % strc +  if __name__ == "__main__":      from optparse import OptionParser      parser = OptionParser(usage="usage: %prog [options] command args...") @@ -140,5 +168,5 @@ if __name__ == "__main__":                vars=dict([(pair.split('=', 1) + [""])[:2] for pair in opts.vars]))      if rc not in (None, 0):          print >>sys.stderr, "Failure running: %s" % " ".join(args) -        print >>sys.stderr, "Error: %s" % rc +        print >>sys.stderr, "Error %s: %s" % (rc, translate_rc(rc))      sys.exit((rc < 0) and 255 or rc) | 
