File tree Expand file tree Collapse file tree 2 files changed +16
-5
lines changed Expand file tree Collapse file tree 2 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -270,15 +270,26 @@ add_test(NAME python_tests
270
270
--start-directory "${CMAKE_CURRENT_SOURCE_DIR} /tests"
271
271
--verbose
272
272
)
273
+
274
+ # List the examples we want to test. Some examples might run too long for
275
+ # testing, or might require additional libraries.
276
+ # Leave off the .py extension; here, we are listing module names.
277
+ set (PYTHON_EXAMPLES_UNITTEST_ARGS
278
+ build_simple_arm_model
279
+ extend_OpenSim_Vec3_class
280
+ posthoc_StatesTrajectory_example
281
+ wiring_inputs_and_outputs_with_TableReporter
282
+ )
273
283
# Similar as above, but for the example files. These files aren't named as
274
284
# test_*.py, so we must specify a more general search pattern.
275
285
add_test (NAME python_examples
276
286
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR} /$<CONFIG>"
277
- COMMAND "${PYTHON_EXECUTABLE} " -m unittest discover
278
- --start-directory "${CMAKE_CURRENT_SOURCE_DIR} /examples"
279
- --pattern *.py
287
+ COMMAND "${PYTHON_EXECUTABLE} " -m unittest
288
+ ${PYTHON_EXAMPLES_UNITTEST_ARGS}
280
289
--verbose
281
290
)
291
+ set_tests_properties (python_examples PROPERTIES
292
+ ENVIRONMENT PYTHONPATH=${CMAKE_CURRENT_SOURCE_DIR}/examples )
282
293
283
294
if (WIN32 )
284
295
# On Windows, CMake cannot use RPATH to hard code the location of libraries
Original file line number Diff line number Diff line change @@ -43,5 +43,5 @@ def myVec3Add(self,v):
43
43
a = osim .Vec3 (1 ,2 ,3 )
44
44
b = osim .Vec3 (4 ,5 ,6 )
45
45
c = a + b
46
- print c
47
- print type (c )
46
+ print ( c )
47
+ print ( type (c ) )
You can’t perform that action at this time.
0 commit comments