Changeset 2b10f95 for tests/pybin


Ignore:
Timestamp:
Mar 27, 2019, 11:09:15 AM (5 years ago)
Author:
tdelisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
86fb8f2
Parents:
1bb2488
Message:

Improved printing, added support for cpp tests and fix byte string concatenation error

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/pybin/tools.py

    r1bb2488 r2b10f95  
    3737        # otherwise create a pipe and run the desired command
    3838        else :
    39                 proc = subprocess.run(
    40                         cmd,
    41                         stdout=None if print2stdout else PIPE,
    42                         stderr=STDOUT,
    43                         shell=True,
    44                         timeout=settings.timeout.single if timeout else None
    45                 )
    46                 return proc.returncode, proc.stdout
     39                try:
     40                        proc = subprocess.run(
     41                                cmd,
     42                                stdout=None if print2stdout else PIPE,
     43                                stderr=STDOUT,
     44                                shell=True,
     45                                timeout=settings.timeout.single if timeout else None
     46                        )
     47                        return proc.returncode, proc.stdout.decode("utf-8") if proc.stdout else None
     48                except subprocess.TimeoutExpired:
     49                        return 124, str(None)
    4750
    4851def is_ascii(fname):
Note: See TracChangeset for help on using the changeset viewer.