Skip to content

Commit

Permalink
Refs #20827: Debug python paths
Browse files Browse the repository at this point in the history
Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
  • Loading branch information
Mario-DL committed May 6, 2024
1 parent 87d87e1 commit 4e4441a
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 6 deletions.
19 changes: 19 additions & 0 deletions test/system/tools/fastdds/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@

find_package(Python3 COMPONENTS Interpreter REQUIRED)

# Set environment
set(TEST_ENVIRONMENT
"PATH=$ENV{PATH};$<TARGET_FILE_DIR:fastcdr>;$<TARGET_FILE_DIR:fastrtps>")

if(Python3_Interpreter_FOUND)

set(TESTS
Expand All @@ -41,6 +45,7 @@ if(Python3_Interpreter_FOUND)
set_property(
TEST system.tools.fastdds.${TEST}
PROPERTY LABELS "NoMemoryCheck"
ENVIRONMENT "${TEST_ENVIRONMENT}"
)

endforeach()
Expand Down Expand Up @@ -170,6 +175,13 @@ endif()
# Define test
add_test(NAME xml.validate COMMAND ${env_fast_command} xml validate xmldocuments)

# Set test properties
set_property(
TEST xml.validate
PROPERTY LABELS "NoMemoryCheck"
ENVIRONMENT "${TEST_ENVIRONMENT}"
)

###############################################################################
# XML Static discovery validation
###############################################################################
Expand Down Expand Up @@ -224,3 +236,10 @@ endforeach()

# Define test
add_test(NAME xml.static_disc_validate COMMAND ${env_fast_command} xml validate xml_static_disc_docs -x ${CMAKE_SOURCE_DIR}/resources/xsd/fastdds_static_discovery.xsd)

# Set test properties
set_property(
TEST xml.static_disc_validate
PROPERTY LABELS "NoMemoryCheck"
ENVIRONMENT "${TEST_ENVIRONMENT}"
)
20 changes: 14 additions & 6 deletions test/system/tools/fastdds/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,10 @@ def cmd(install_path, setup_script_path=Path(), args=''):


def test_fastdds_installed(install_path):
env = os.environ.copy()
"""Test that fastdds is installed and runs."""
ret = subprocess.call(cmd(install_path), shell=True)
env = os.environ.copy()
ret = subprocess.call(cmd(install_path), shell=True, env=env)
if 0 != ret:
print('test_fastdds_installed FAILED')
sys.exit(ret)
Expand All @@ -100,21 +102,24 @@ def test_fastdds_installed(install_path):
def test_fastdds_shm(install_path):
"""Test that shm command runs."""
args = ' shm clean'
env = os.environ.copy()
ret = subprocess.call(cmd(
install_path=install_path, args=args), shell=True)
install_path=install_path, args=args), shell=True, env=env)
if 0 != ret:
print('test_fastdds_shm FAILED')
sys.exit(ret)


def test_fastdds_discovery(install_path, setup_script_path):
"""Test that discovery command runs."""
env = os.environ.copy()
args = ' discovery'
env = os.environ.copy()
ret = subprocess.call(
cmd(install_path=install_path,
setup_script_path=setup_script_path,
args=args),
shell=True)
shell=True,
env=env)

if 0 != ret:
print('test_fastdds_discovery FAILED')
Expand All @@ -123,10 +128,12 @@ def test_fastdds_discovery(install_path, setup_script_path):

def test_ros_discovery(install_path, setup_script_path):
"""Test that discovery command runs."""
env = os.environ.copy()
ret = subprocess.call(
cmd(install_path=install_path,
setup_script_path=setup_script_path),
shell=True)
shell=True,
env=env)

if 0 != ret:
print('test_fastdds_discovery FAILED')
Expand All @@ -136,8 +143,9 @@ def test_ros_discovery(install_path, setup_script_path):
def test_fastdds_xml_validate(install_path):
"""Test that xml validate command runs."""
args = ' xml validate'
env = os.environ.copy()
ret = subprocess.call(cmd(
install_path=install_path, args=args), shell=True)
install_path=install_path, args=args), shell=True, env=env)
if 0 != ret:
print('test_fastdds_xml_validate FAILED')
sys.exit(ret)
Expand Down
3 changes: 3 additions & 0 deletions tools/fastdds/fastdds.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,7 @@ def xml(self):

if __name__ == '__main__':

print ("Fastdds.py paths:")
print (sys.path)

FastDDSParser()
1 change: 1 addition & 0 deletions tools/fastdds/shm/clean.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from pathlib import Path
import sys

print ("clean.py paths:")
print (sys.path)

if os.name == 'posix':
Expand Down

0 comments on commit 4e4441a

Please sign in to comment.