Skip to content

Commit c3c4da1

Browse files
authored
Split dynamics integration test binary and normalize test names (#2260)
1 parent abbc91f commit c3c4da1

12 files changed

+431
-382
lines changed

tests/helpers/GTestUtils.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ bool equals(
245245
}
246246

247247
//==============================================================================
248-
bool rotationEquals(
248+
inline bool rotationEquals(
249249
const Eigen::Matrix3d& rot1, const Eigen::Matrix3d& rot2, double tol = 1e-5)
250250
{
251251
const Eigen::Matrix3d rotError = rot1.transpose() * rot2;
@@ -254,7 +254,7 @@ bool rotationEquals(
254254
}
255255

256256
//==============================================================================
257-
bool equals(
257+
inline bool equals(
258258
const Eigen::Isometry3d& tf1,
259259
const Eigen::Isometry3d& tf2,
260260
double tol = 1e-5)

tests/helpers/dynamics_helpers.hpp

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ enum TypeOfDOF
6262

6363
//==============================================================================
6464
/// Add an end-effector to the last link of the given robot
65-
void addEndEffector(SkeletonPtr robot, BodyNode* parent_node, Vector3d dim)
65+
inline void addEndEffector(
66+
SkeletonPtr robot, BodyNode* parent_node, Vector3d dim)
6667
{
6768
// Create the end-effector node with a random dimension
6869
BodyNode::Properties node(BodyNode::AspectProperties("ee"));
@@ -80,7 +81,7 @@ void addEndEffector(SkeletonPtr robot, BodyNode* parent_node, Vector3d dim)
8081
}
8182

8283
//==============================================================================
83-
std::pair<Joint*, BodyNode*> add1DofJoint(
84+
inline std::pair<Joint*, BodyNode*> add1DofJoint(
8485
SkeletonPtr skel,
8586
BodyNode* parent,
8687
const BodyNode::Properties& node,
@@ -131,7 +132,7 @@ std::pair<Joint*, BodyNode*> add1DofJoint(
131132

132133
//==============================================================================
133134
/// Creates an arbitrary three-link robot consisting of Single-DOF joints
134-
SkeletonPtr createThreeLinkRobot(
135+
inline SkeletonPtr createThreeLinkRobot(
135136
Vector3d dim1,
136137
TypeOfDOF type1,
137138
Vector3d dim2,
@@ -219,7 +220,7 @@ SkeletonPtr createThreeLinkRobot(
219220

220221
//==============================================================================
221222
/// Creates an arbitrary two-link robot consisting of Single-DOF joints
222-
SkeletonPtr createTwoLinkRobot(
223+
inline SkeletonPtr createTwoLinkRobot(
223224
Vector3d dim1,
224225
TypeOfDOF type1,
225226
Vector3d dim2,
@@ -241,7 +242,7 @@ SkeletonPtr createTwoLinkRobot(
241242
//==============================================================================
242243
/// Creates a N link manipulator with the given dimensions where each joint is
243244
/// the specified type
244-
SkeletonPtr createNLinkRobot(
245+
inline SkeletonPtr createNLinkRobot(
245246
int _n, Vector3d dim, TypeOfDOF type, bool finished = false)
246247
{
247248
DART_ASSERT(_n > 0);
@@ -306,7 +307,7 @@ SkeletonPtr createNLinkRobot(
306307
/// Creates a N link pendulum with the given dimensions where each joint is
307308
/// the specified type. The each offset from the joint position to the child
308309
/// body is specified.
309-
SkeletonPtr createNLinkPendulum(
310+
inline SkeletonPtr createNLinkPendulum(
310311
size_t numBodyNodes,
311312
const Vector3d& dim,
312313
TypeOfDOF type,
@@ -375,7 +376,7 @@ SkeletonPtr createNLinkPendulum(
375376
}
376377

377378
//==============================================================================
378-
SkeletonPtr createGround(
379+
inline SkeletonPtr createGround(
379380
const Eigen::Vector3d& _size,
380381
const Eigen::Vector3d& _position = Eigen::Vector3d::Zero(),
381382
const Eigen::Vector3d& _orientation = Eigen::Vector3d::Zero())
@@ -403,7 +404,7 @@ SkeletonPtr createGround(
403404
}
404405

405406
//==============================================================================
406-
SkeletonPtr createObject(
407+
inline SkeletonPtr createObject(
407408
const Eigen::Vector3d& _position = Eigen::Vector3d::Zero(),
408409
const Eigen::Vector3d& _orientation = Eigen::Vector3d::Zero())
409410
{
@@ -426,7 +427,7 @@ SkeletonPtr createObject(
426427
}
427428

428429
//==============================================================================
429-
SkeletonPtr createSphere(
430+
inline SkeletonPtr createSphere(
430431
const double _radius,
431432
const Eigen::Vector3d& _position = Eigen::Vector3d::Zero())
432433
{
@@ -442,7 +443,7 @@ SkeletonPtr createSphere(
442443
}
443444

444445
//==============================================================================
445-
SkeletonPtr createBox(
446+
inline SkeletonPtr createBox(
446447
const Eigen::Vector3d& _size,
447448
const Eigen::Vector3d& _position = Eigen::Vector3d::Zero(),
448449
const Eigen::Vector3d& _orientation = Eigen::Vector3d::Zero())

tests/integration/CMakeLists.txt

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,37 @@ dart_build_tests(
6969
)
7070

7171
if(TARGET dart-utils)
72-
dart_add_test("integration" INTEGRATION_dynamics_Dynamics dynamics/test_Dynamics.cpp)
73-
target_link_libraries(INTEGRATION_dynamics_Dynamics dart-utils)
72+
set(DYNAMICS_TEST_FIXTURE dynamics/DynamicsTestFixture.cpp)
73+
74+
dart_add_test("integration" INTEGRATION_dynamics_DynamicsJacobians
75+
${DYNAMICS_TEST_FIXTURE}
76+
dynamics/test_DynamicsJacobians.cpp)
77+
target_link_libraries(INTEGRATION_dynamics_DynamicsJacobians dart-utils)
78+
79+
dart_add_test("integration" INTEGRATION_dynamics_DynamicsFiniteDifference
80+
${DYNAMICS_TEST_FIXTURE}
81+
dynamics/test_DynamicsFiniteDifference.cpp)
82+
target_link_libraries(INTEGRATION_dynamics_DynamicsFiniteDifference dart-utils)
83+
84+
dart_add_test("integration" INTEGRATION_dynamics_DynamicsEquations
85+
${DYNAMICS_TEST_FIXTURE}
86+
dynamics/test_DynamicsEquations.cpp)
87+
target_link_libraries(INTEGRATION_dynamics_DynamicsEquations dart-utils)
88+
89+
dart_add_test("integration" INTEGRATION_dynamics_DynamicsCenterOfMass
90+
${DYNAMICS_TEST_FIXTURE}
91+
dynamics/test_DynamicsCenterOfMass.cpp)
92+
target_link_libraries(INTEGRATION_dynamics_DynamicsCenterOfMass dart-utils)
93+
94+
dart_add_test("integration" INTEGRATION_dynamics_DynamicsImpulse
95+
${DYNAMICS_TEST_FIXTURE}
96+
dynamics/test_DynamicsImpulse.cpp)
97+
target_link_libraries(INTEGRATION_dynamics_DynamicsImpulse dart-utils)
98+
99+
dart_add_test("integration" INTEGRATION_dynamics_DynamicsHybrid
100+
${DYNAMICS_TEST_FIXTURE}
101+
dynamics/test_DynamicsHybrid.cpp)
102+
target_link_libraries(INTEGRATION_dynamics_DynamicsHybrid dart-utils)
74103

75104
dart_add_test("integration" INTEGRATION_dynamics_Joints dynamics/test_Joints.cpp)
76105
target_link_libraries(INTEGRATION_dynamics_Joints dart-utils)

0 commit comments

Comments
 (0)