Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions OpenSim/Simulation/SimbodyEngine/Test/testJoints.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
#include <OpenSim/Common/Constant.h>
#include <OpenSim/Common/FunctionAdapter.h>
#include <OpenSim/Common/LinearFunction.h>
#include <OpenSim/Common/LoadOpenSimLibrary.h>
#include <OpenSim/Common/SimmSpline.h>
#include <OpenSim/Simulation/Manager/Manager.h>
#include <OpenSim/Simulation/Model/BodySet.h>
Expand All @@ -69,6 +68,7 @@
#include <OpenSim/Simulation/SimbodyEngine/WeldConstraint.h>
#include <OpenSim/Simulation/SimbodyEngine/WeldJoint.h>
#include <OpenSim/Simulation/Test/SimulationComponentsForTesting.h>
#include <OpenSim/Actuators/PointActuator.h>

#include <memory>
#include <catch2/catch_all.hpp>
Expand Down Expand Up @@ -2059,9 +2059,12 @@ TEST_CASE("testEquivalentBodyForceFromGeneralizedForce") {
"==="
<< endl;

// Need to load osim actuators because the following model has
// Actuators that will fail to register and the model will not load.
LoadOpenSimLibrary("osimActuators");
// The following model(s) contains Actuators that are registered when the
// osimActuators library is loaded. But unless we call at least one
// function defined in the osimActuators library, some linkers will omit
// its dependency from the executable and it will not be loaded at
// startup.
{ PointActuator t; }

Model gaitModel("testJointConstraints.osim");

Expand Down
11 changes: 9 additions & 2 deletions OpenSim/Simulation/Test/testInitState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <OpenSim/Simulation/Manager/Manager.h>
#include <OpenSim/Simulation/Control/ControlSetController.h>
#include <OpenSim/Simulation/Model/Model.h>
#include <OpenSim/Common/LoadOpenSimLibrary.h>
#include <OpenSim/Actuators/PointActuator.h>
#include <OpenSim/Auxiliary/auxiliaryTestFunctions.h>
#include <catch2/catch_all.hpp>

Expand All @@ -41,7 +41,14 @@ using namespace std;
TEST_CASE("testStates")
{
using namespace SimTK;
LoadOpenSimLibrary("osimActuators");

// The following model(s) contains Actuators that are registered when the
// osimActuators library is loaded. But unless we call at least one
// function defined in the osimActuators library, some linkers will omit
// its dependency from the executable and it will not be loaded at
// startup.
{ PointActuator t; }

//==========================================================================
// Setup OpenSim model
std::string modelFile = "arm26.osim";
Expand Down
9 changes: 7 additions & 2 deletions OpenSim/Simulation/Test/testModelInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <OpenSim/Simulation/Model/PhysicalOffsetFrame.h>
#include <OpenSim/Simulation/SimbodyEngine/PinJoint.h>
#include <OpenSim/Simulation/Manager/Manager.h>
#include <OpenSim/Common/LoadOpenSimLibrary.h>
#include <OpenSim/Actuators/PointActuator.h>

#include <memory>

Expand All @@ -37,7 +37,12 @@ void testModelTopologyErrors();
void testDoesNotSegfaultWithUnusualConnections();

int main() {
LoadOpenSimLibrary("osimActuators");
// The following model(s) contains Actuators that are registered when the
// osimActuators library is loaded. But unless we call at least one
// function defined in the osimActuators library, some linkers will omit
// its dependency from the executable and it will not be loaded at
// startup.
{ PointActuator t; }

SimTK_START_TEST("testModelInterface");
SimTK_SUBTEST(testModelFinalizePropertiesAndConnections);
Expand Down
2 changes: 0 additions & 2 deletions OpenSim/Simulation/Test/testMomentArms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
#include <OpenSim/Simulation/osimSimulation.h>
#include <OpenSim/Actuators/Thelen2003Muscle.h>
#include <OpenSim/Auxiliary/auxiliaryTestFunctions.h>
#include <OpenSim/Common/LoadOpenSimLibrary.h>

#include "SimulationComponentsForTesting.h"

Expand All @@ -59,7 +58,6 @@ void testMomentArmsAcrossCompoundJoint();
int main()
{
clock_t startTime = clock();
LoadOpenSimLibrary("osimActuators");
Object::registerType(CompoundJoint());

try {
Expand Down
9 changes: 7 additions & 2 deletions OpenSim/Simulation/Test/testSimulationUtilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,20 @@
#include <OpenSim/Simulation/Model/Model.h>
#include <OpenSim/Simulation/SimbodyEngine/FreeJoint.h>
#include <OpenSim/Simulation/SimulationUtilities.h>
#include <OpenSim/Common/LoadOpenSimLibrary.h>
#include <OpenSim/Actuators/PointActuator.h>

using namespace OpenSim;
using namespace std;

void testUpdatePre40KinematicsFor40MotionType();

int main() {
LoadOpenSimLibrary("osimActuators");
// The following model(s) contains Actuators that are registered when the
// osimActuators library is loaded. But unless we call at least one
// function defined in the osimActuators library, some linkers will omit
// its dependency from the executable and it will not be loaded at
// startup.
{ PointActuator t; }

SimTK_START_TEST("testSimulationUtilities");
SimTK_SUBTEST(testUpdatePre40KinematicsFor40MotionType);
Expand Down
13 changes: 8 additions & 5 deletions OpenSim/Simulation/Test/testStatesTrajectory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

#include <OpenSim/Simulation/osimSimulation.h>
#include <OpenSim/Common/Constant.h>
#include <OpenSim/Common/LoadOpenSimLibrary.h>
#include <OpenSim/Actuators/PointActuator.h>
#include <random>
#include <cstdio>
#include <OpenSim/Auxiliary/auxiliaryTestFunctions.h>
Expand Down Expand Up @@ -776,10 +776,13 @@ void testExport() {

int main() {
SimTK_START_TEST("testStatesTrajectory");
// actuators library is not loaded automatically (unless using clang).
#if !defined(__clang__)
LoadOpenSimLibrary("osimActuators");
#endif

// The following model(s) contains Actuators that are registered when the
// osimActuators library is loaded. But unless we call at least one
// function defined in the osimActuators library, some linkers will omit
// its dependency from the executable and it will not be loaded at
// startup.
{ PointActuator t; }

// Make sure the states Storage file doesn't already exist; we'll
// generate it later and we don't want to use a stale one by accident.
Expand Down
Loading