Skip to content

Commit

Permalink
Use gtest_main (#856)
Browse files Browse the repository at this point in the history
  • Loading branch information
jslee02 authored Mar 19, 2017
1 parent e87382a commit 2945b27
Show file tree
Hide file tree
Showing 38 changed files with 6 additions and 289 deletions.
8 changes: 6 additions & 2 deletions unittests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,13 @@ function(dart_add_test test_type target_name) # ARGN for source files
"${DART_TEST_OUT_DIR}/${test_type}/${target_name}")

if(MSVC)
target_link_libraries(${target_name} dart optimized gtest debug gtestd)
target_link_libraries(${target_name}
dart
optimized gtest debug gtestd
optimized gtest_main debug gtest_maind
)
else()
target_link_libraries(${target_name} dart gtest)
target_link_libraries(${target_name} dart gtest gtest_main)
endif()

set_target_properties(
Expand Down
7 changes: 0 additions & 7 deletions unittests/comprehensive/test_Building.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,3 @@ TEST(BUILDING, BASIC)
for (int i = 0; i < nSteps; ++i)
world->step();
}

/******************************************************************************/
int main(int argc, char* argv[])
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
8 changes: 0 additions & 8 deletions unittests/comprehensive/test_Collision.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1174,11 +1174,3 @@ TEST_F(COLLISION, CollisionOfPrescribedJoints)
EXPECT_NEAR(joint6->getAcceleration(0), 0.0, tol);
}
}

//==============================================================================
int main(int argc, char* argv[])
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}

8 changes: 0 additions & 8 deletions unittests/comprehensive/test_Common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,3 @@ TEST(Common, Timer)
EXPECT_GE(timer2.getTotalElapsedTime(), 2.0);
#endif
}

//==============================================================================
int main(int argc, char* argv[])
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}

7 changes: 0 additions & 7 deletions unittests/comprehensive/test_Concurrency.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,3 @@ TEST(Concurrency, FrameDeletion)
EXPECT_EQ(Frame::World()->getNumChildEntities(), 0);
EXPECT_EQ(Frame::World()->getNumChildFrames(), 0);
}

//==============================================================================
int main(int argc, char* argv[])
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
8 changes: 0 additions & 8 deletions unittests/comprehensive/test_Constraint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,3 @@ TEST_F(ConstraintTest, SingleContactTest)

SingleContactTest(getList()[0]);
}

//==============================================================================
int main(int argc, char* argv[])
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}

7 changes: 0 additions & 7 deletions unittests/comprehensive/test_Distance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,10 +289,3 @@ TEST(Distance, SphereSphere)
auto dart = DARTCollisionDetector::create();
testSphereSphere(dart);
}

//==============================================================================
int main(int argc, char* argv[])
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
7 changes: 0 additions & 7 deletions unittests/comprehensive/test_Dynamics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2129,10 +2129,3 @@ TEST_F(DynamicsTest, HybridDynamics)
EXPECT_NEAR(command(i,4), output(i,4), tol);
}
}

//==============================================================================
int main(int argc, char* argv[])
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
7 changes: 0 additions & 7 deletions unittests/comprehensive/test_ForwardKinematics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,3 @@ TEST(FORWARD_KINEMATICS, JACOBIAN_END_EFFECTOR_CHANGE)

EXPECT_TRUE((fd_J - J).norm() < tolerance);
}

//==============================================================================
int main(int argc, char* argv[])
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
8 changes: 0 additions & 8 deletions unittests/comprehensive/test_Frames.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -737,11 +737,3 @@ TEST(FRAMES, CHILDHOOD)

EXPECT_TRUE(F1.getNumChildFrames() == 1);
}

int main(int argc, char* argv[])
{
srand(271828); // Seed with an arbitrary fixed integer. Don't seed with time,
// because it will produce different numbers between runs.
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
7 changes: 0 additions & 7 deletions unittests/comprehensive/test_InverseKinematics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,3 @@ SkeletonPtr createFreeFloatingTwoLinkRobot(Vector3d dim1,
// }
//}
#endif

//==============================================================================
int main(int argc, char* argv[])
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
8 changes: 0 additions & 8 deletions unittests/comprehensive/test_Joints.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1299,11 +1299,3 @@ TEST_F(JOINTS, FREE_JOINT_RELATIVE_TRANSFORM_VELOCITY_ACCELERATION)
}
}
}

//==============================================================================
int main(int argc, char* argv[])
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}

7 changes: 0 additions & 7 deletions unittests/comprehensive/test_NameManagement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,10 +417,3 @@ TEST(NameManagement, JointDegreeOfFreedom)
EXPECT_TRUE( joint->getDof(1)->getName() == "j_bicep_left_y" );
EXPECT_TRUE( joint->getDof(2)->getName() == "j_bicep_left_z" );
}

//==============================================================================
int main(int argc, char* argv[])
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
6 changes: 0 additions & 6 deletions unittests/comprehensive/test_Skeleton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1288,9 +1288,3 @@ TEST(Skeleton, Updating)
EXPECT_FALSE(originalMass == newMass);
EXPECT_TRUE(newMass == originalMass - removedMass);
}

int main(int argc, char* argv[])
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
7 changes: 0 additions & 7 deletions unittests/comprehensive/test_SoftDynamics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -457,10 +457,3 @@ TEST_F(SoftDynamicsTest, compareEquationsOfMotion)
// compareEquationsOfMotion(getList()[i]);
// }
}

//==============================================================================
int main(int argc, char* argv[])
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
7 changes: 0 additions & 7 deletions unittests/comprehensive/test_World.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,10 +302,3 @@ TEST(World, ValidatingClones)
}
}
}

//==============================================================================
int main(int argc, char* argv[])
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
7 changes: 0 additions & 7 deletions unittests/regression/test_Issue000Template.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,3 @@ TEST(Issue000Template, Basic)
{
// Add test code here
}

//==============================================================================
int main(int argc, char* argv[])
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
1 change: 0 additions & 1 deletion unittests/unit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ dart_add_test("unit" test_ScrewJoint)
dart_add_test("unit" test_Signal)
dart_add_test("unit" test_Subscriptions)
dart_add_test("unit" test_Uri)
dart_add_test("unit" test_Utilities)

if(TARGET dart-optimizer-ipopt)
target_link_libraries(test_Optimizer dart-optimizer-ipopt)
Expand Down
6 changes: 0 additions & 6 deletions unittests/unit/test_Aspect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -977,9 +977,3 @@ TEST(Aspect, Embedded)
EmbeddedStateComposite s_constructed(state);
EXPECT_EQ(s_constructed.get<EmbeddedStateComposite::Aspect>()->getState(), state);
}

int main(int argc, char* argv[])
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
6 changes: 0 additions & 6 deletions unittests/unit/test_CompositeResourceRetriever.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,3 @@ TEST(CompositeResourceRetriever, retrieve_DefaultResourceRetrieverSucceeds_Retur
EXPECT_TRUE(retriever3->mExists.empty());
EXPECT_TRUE(retriever3->mRetrieve.empty());
}

int main(int argc, char* argv[])
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
7 changes: 0 additions & 7 deletions unittests/unit/test_ContactConstraint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,3 @@ TEST(ContactConstraint, ContactWithKinematicJoint)
EXPECT_NEAR(bodyNode2->getLinearVelocity()[0], 0.1, 1e-6);
}
}

//==============================================================================
int main(int argc, char* argv[])
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
6 changes: 0 additions & 6 deletions unittests/unit/test_DartLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,3 @@ TEST(DartLoader, parseWorld)
EXPECT_TRUE(nullptr !=
loader.parseWorld(DART_DATA_PATH"urdf/test/testWorld.urdf"));
}

int main(int argc, char* argv[])
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
7 changes: 0 additions & 7 deletions unittests/unit/test_FileInfoWorld.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,3 @@ TEST(FileInfoWorld, Basic)
}
}
}

//==============================================================================
int main(int argc, char* argv[])
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
7 changes: 0 additions & 7 deletions unittests/unit/test_GenericJoints.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,3 @@ TEST(GenericJoint, Basic)
MultiDofJointTest genericJoint;
SO3JointTest so3Joint;
}

//==============================================================================
int main(int argc, char* argv[])
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
9 changes: 0 additions & 9 deletions unittests/unit/test_Geometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -593,12 +593,3 @@ TEST(LIE_GROUP_OPERATORS, ADJOINT_MAPPINGS)
EXPECT_NEAR(dad_V_F(j), dadV_Matrix_F(j), LIE_GROUP_OPT_TOL);
}
}

/******************************************************************************/
int main(int argc, char* argv[])
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}


6 changes: 0 additions & 6 deletions unittests/unit/test_LocalResourceRetriever.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,3 @@ TEST(LocalResourceRetriever, retrieve_ResourceOperations)
ASSERT_EQ(1u, resource->read(buffer.data(), content.size(), 1));
EXPECT_STREQ(content.c_str(), buffer.data());
}

int main(int argc, char* argv[])
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
7 changes: 0 additions & 7 deletions unittests/unit/test_Math.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1293,10 +1293,3 @@ TEST(MATH, PerformanceComparisonOfAdTJac)
// Note: The best function for dynamic size Jacobian is AdTJac2, and the best
// function for fixed size Jacobian is AdTJac3
}

//==============================================================================
int main(int argc, char* argv[])
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
6 changes: 0 additions & 6 deletions unittests/unit/test_NearestNeighbor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,3 @@ TEST(NEAREST_NEIGHBOR, 2D) {
EXPECT_TRUE(equality);
}
#endif // HAVE_FLANN

/* ********************************************************************************************* */
int main(int argc, char* argv[]) {
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
7 changes: 0 additions & 7 deletions unittests/unit/test_Optimizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,10 +299,3 @@ TEST(Optimizer, OutStream)

std::remove(outputFile.c_str());
}

//==============================================================================
int main(int argc, char* argv[])
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
6 changes: 0 additions & 6 deletions unittests/unit/test_PackageResourceRetriever.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,3 @@ TEST(PackageResourceRetriever, retrieve_FallsBackOnSecondUri)
EXPECT_EQ(expected1, mockRetriever->mRetrieve[0]);
EXPECT_EQ(expected2, mockRetriever->mRetrieve[1]);
}

int main(int argc, char* argv[])
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
8 changes: 0 additions & 8 deletions unittests/unit/test_ScrewJoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,3 @@ TEST(ScrewJoint, ThreadPitch)
expectedDiff = axis*pitch*angle/2.0_pi;
EXPECT_TRUE(diff.isApprox(expectedDiff));
}

//==============================================================================
int main(int argc, char* argv[])
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}

7 changes: 0 additions & 7 deletions unittests/unit/test_SdfParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,3 @@ TEST(SdfParser, ReadMaterial)
}

}

//==============================================================================
int main(int argc, char* argv[])
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
8 changes: 0 additions & 8 deletions unittests/unit/test_Signal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,11 +326,3 @@ TEST(Signal, FrameSignals)

F3.setParentFrame(&F1);
}

//==============================================================================
int main(int argc, char* argv[])
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}

7 changes: 0 additions & 7 deletions unittests/unit/test_SkelParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -525,10 +525,3 @@ TEST(SkelParser, Shapes)
skel = world->getSkeleton("mesh skeleton");
EXPECT_NE(skel, nullptr);
}

//==============================================================================
int main(int argc, char* argv[])
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
6 changes: 0 additions & 6 deletions unittests/unit/test_Subscriptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,3 @@ TEST(Subjects, ImplicitConversion)

delete entity_ptr;
}

int main(int argc, char* argv[])
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
6 changes: 0 additions & 6 deletions unittests/unit/test_Uri.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,9 +334,3 @@ TEST(UriHelpers, getRelativeUri)
EXPECT_EQ("http://a/b/c/g", mergedUri.toString());
#endif
}

int main(int argc, char* argv[])
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
Loading

0 comments on commit 2945b27

Please sign in to comment.