File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import logging
22import os
3+ import re
34import shlex
45import signal
56import shutil
@@ -402,6 +403,25 @@ def test_generated_ros2_package_works(self):
402403 self ._terminate_process (echo_process )
403404
404405 self .assertIn ("solution" , echo_stdout )
406+ # A bit of integration testing: check whether the solver was able to
407+ # solve the problem successfully
408+ self .assertRegex (
409+ echo_stdout ,
410+ r"solution:\s*\n(?:- .+\n)+" ,
411+ msg = f"Expected a non-empty solution vector in result output:\n { echo_stdout } " )
412+ self .assertIn ("status: 0" , echo_stdout )
413+ self .assertRegex (
414+ echo_stdout ,
415+ r"inner_iterations:\s*[1-9]\d*" ,
416+ msg = f"Expected a positive inner iteration count in result output:\n { echo_stdout } " )
417+ self .assertRegex (
418+ echo_stdout ,
419+ r"outer_iterations:\s*[1-9]\d*" ,
420+ msg = f"Expected a positive outer iteration count in result output:\n { echo_stdout } " )
421+ self .assertRegex (
422+ echo_stdout ,
423+ r"cost:\s*-?\d+(?:\.\d+)?(?:e[+-]?\d+)?" ,
424+ msg = f"Expected a numeric cost in result output:\n { echo_stdout } " )
405425 self .assertIn ("solve_time_ms" , echo_stdout )
406426 finally :
407427 if node_process .poll () is None :
You can’t perform that action at this time.
0 commit comments