Skip to content

Commit

Permalink
Merge pull request #2606 from opensim-org/do_not_test_python_cma
Browse files Browse the repository at this point in the history
Do not test CMA example.
  • Loading branch information
aymanhab committed Oct 28, 2019
2 parents 35ab0d5 + f164e72 commit 2476317
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
19 changes: 15 additions & 4 deletions Bindings/Python/CMakeLists.txt
Expand Up @@ -270,15 +270,26 @@ add_test(NAME python_tests
--start-directory "${CMAKE_CURRENT_SOURCE_DIR}/tests"
--verbose
)

# List the examples we want to test. Some examples might run too long for
# testing, or might require additional libraries.
# Leave off the .py extension; here, we are listing module names.
set(PYTHON_EXAMPLES_UNITTEST_ARGS
build_simple_arm_model
extend_OpenSim_Vec3_class
posthoc_StatesTrajectory_example
wiring_inputs_and_outputs_with_TableReporter
)
# Similar as above, but for the example files. These files aren't named as
# test_*.py, so we must specify a more general search pattern.
add_test(NAME python_examples
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>"
COMMAND "${PYTHON_EXECUTABLE}" -m unittest discover
--start-directory "${CMAKE_CURRENT_SOURCE_DIR}/examples"
--pattern *.py
COMMAND "${PYTHON_EXECUTABLE}" -m unittest
${PYTHON_EXAMPLES_UNITTEST_ARGS}
--verbose
)
set_tests_properties(python_examples PROPERTIES
ENVIRONMENT PYTHONPATH=${CMAKE_CURRENT_SOURCE_DIR}/examples)

if(WIN32)
# On Windows, CMake cannot use RPATH to hard code the location of libraries
Expand All @@ -288,7 +299,7 @@ if(WIN32)
# want to accidentally use a different OpenSim build/installation somewhere
# on the machine.
foreach(folder tests examples)
set_tests_properties(python_${folder} PROPERTIES ENVIRONMENT
set_property(TEST python_${folder} APPEND PROPERTY ENVIRONMENT
"PATH=${CMAKE_BINARY_DIR}/$<CONFIG>")
endforeach()
endif()
Expand Down
4 changes: 2 additions & 2 deletions Bindings/Python/examples/extend_OpenSim_Vec3_class.py
Expand Up @@ -43,5 +43,5 @@ def myVec3Add(self,v):
a = osim.Vec3(1,2,3)
b = osim.Vec3(4,5,6)
c = a+b
print c
print type(c)
print(c)
print(type(c))

0 comments on commit 2476317

Please sign in to comment.