Skip to content

Commit

Permalink
ament_cmake_tests: add support for TEST_REFIX to run_test.py
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Wecht <[email protected]>
  • Loading branch information
cwecht committed Sep 9, 2022
1 parent ca8c26e commit 6d85c97
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ament_cmake_test/ament_cmake_test/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import subprocess
import sys
import time
import shlex
from xml.etree.ElementTree import ElementTree
from xml.etree.ElementTree import ParseError
from xml.sax.saxutils import quoteattr
Expand Down Expand Up @@ -197,9 +198,14 @@ def log(msg, **kwargs):

start_time = time.monotonic()

cmd = args.command
if 'TEST_PREFIX' in os.environ:
os_posix = os.name == "posix"
cmd = shlex.split(os.environ['TEST_PREFIX'], os_posix) + cmd

try:
proc = subprocess.Popen(
args.command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
env=env)
while True:
line = proc.stdout.readline()
Expand Down

0 comments on commit 6d85c97

Please sign in to comment.