Skip to content

Commit 6d85c97

Browse files
committed
ament_cmake_tests: add support for TEST_REFIX to run_test.py
Signed-off-by: Christopher Wecht <[email protected]>
1 parent ca8c26e commit 6d85c97

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ament_cmake_test/ament_cmake_test/__init__.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import subprocess
2222
import sys
2323
import time
24+
import shlex
2425
from xml.etree.ElementTree import ElementTree
2526
from xml.etree.ElementTree import ParseError
2627
from xml.sax.saxutils import quoteattr
@@ -197,9 +198,14 @@ def log(msg, **kwargs):
197198

198199
start_time = time.monotonic()
199200

201+
cmd = args.command
202+
if 'TEST_PREFIX' in os.environ:
203+
os_posix = os.name == "posix"
204+
cmd = shlex.split(os.environ['TEST_PREFIX'], os_posix) + cmd
205+
200206
try:
201207
proc = subprocess.Popen(
202-
args.command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
208+
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
203209
env=env)
204210
while True:
205211
line = proc.stdout.readline()

0 commit comments

Comments
 (0)