Skip to content

Commit

Permalink
Merge pull request #759 from robotology/enable-ipopt-tests
Browse files Browse the repository at this point in the history
GitHub Actions: Enable IPOPT tests on macOS
  • Loading branch information
traversaro authored Nov 17, 2020
2 parents eef45c6 + 8427526 commit 8202c39
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
- name: Dependencies [macOS]
if: matrix.os == 'macOS-latest'
run: |
brew install ace assimp boost eigen swig qt5 orocos-kdl
brew install ace assimp boost eigen ipopt swig qt5 orocos-kdl
- name: Dependencies [Ubuntu]
if: contains(matrix.os, 'ubuntu')
Expand Down Expand Up @@ -171,7 +171,7 @@ jobs:
cd build
cmake -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install/deps -DIDYNTREE_COMPILE_TESTS:BOOL=ON -DIDYNTREE_USES_YARP:BOOL=ON \
-DIDYNTREE_USES_ICUB_MAIN:BOOL=ON -DIDYNTREE_USES_Qt5:BOOL=ON -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DIDYNTREE_USES_ASSIMP:BOOL=ON \
-DIDYNTREE_USES_OCTAVE:BOOL=ON -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install ..
-DIDYNTREE_USES_IPOPT:BOOL=ON -DIDYNTREE_USES_OCTAVE:BOOL=ON -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install ..
- name: Enable additional Ubuntu options (Valgrind, Python, legacy KDL) [Ubuntu]
if: contains(matrix.os, 'ubuntu')
Expand Down
5 changes: 3 additions & 2 deletions src/optimalcontrol/tests/IpoptInterfaceTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,14 +210,15 @@ int main(){
ASSERT_IS_TRUE(problem->setMinusInfinity(ipoptSolver.minusInfinity()));
ASSERT_IS_TRUE(problem->setPlusInfinity(ipoptSolver.plusInfinity()));
ASSERT_IS_TRUE(ipoptSolver.setProblem(problem));
double testTolerance = 5e-5;
for (int i = 0; i < 5; ++i){
ASSERT_IS_TRUE(ipoptSolver.solve());
double optimalCost;
ASSERT_IS_TRUE(ipoptSolver.getOptimalCost(optimalCost));
ASSERT_EQUAL_DOUBLE_TOL(optimalCost, problem->expectedMinimum(), 1e-5);
ASSERT_EQUAL_DOUBLE_TOL(optimalCost, problem->expectedMinimum(), testTolerance);
iDynTree::VectorDynSize solution;
ASSERT_IS_TRUE(ipoptSolver.getPrimalVariables(solution));
ASSERT_EQUAL_VECTOR_TOL(solution, problem->expectedVariables(), 1e-5);
ASSERT_EQUAL_VECTOR_TOL(solution, problem->expectedVariables(), testTolerance);
ASSERT_IS_TRUE(ipoptSolver.getDualVariables(dummy1, dummy2, dummy3));
}
return EXIT_SUCCESS;
Expand Down

0 comments on commit 8202c39

Please sign in to comment.