Remove PluginTest and make MujocoTest load plugins.

MujocoTest now loads plugins from MUJOCO_PLUGIN_DIR if set.
PluginTest is removed; all tests use MujocoTest directly.
testspeed binary loads plugins from MUJOCO_PLUGIN_DIR.

This is in preparation for moving common asset format parsing (obj, msh, stl, etc.) where we will always want to load those plugins.

PiperOrigin-RevId: 874194428
Change-Id: Id90805a9ba5de4627911b56d8b9c4ab4e1b29310
This commit is contained in:
Sam Haves
2026-02-23 12:14:37 -08:00
committed by Copybara-Service
parent 6ec808e2ce
commit 82e92cbcaa
8 changed files with 45 additions and 35 deletions
+14 -14
View File
@@ -171,7 +171,7 @@ TEST_F(MujocoTest, TreeTraversal) {
mj_deleteSpec(spec);
}
TEST_F(PluginTest, ActivatePlugin) {
TEST_F(MujocoTest, ActivatePlugin) {
mjSpec* spec = mj_makeSpec();
mjs_activatePlugin(spec, "mujoco.elasticity.cable");
@@ -196,7 +196,7 @@ TEST_F(PluginTest, ActivatePlugin) {
mj_deleteModel(model);
}
TEST_F(PluginTest, DeletePlugin) {
TEST_F(MujocoTest, DeletePlugin) {
mjSpec* spec = mj_makeSpec();
mjs_activatePlugin(spec, "mujoco.pid");
@@ -267,7 +267,7 @@ static constexpr char xml_plugin_2[] = R"(
</actuator>
</mujoco>)";
TEST_F(PluginTest, AttachPlugin) {
TEST_F(MujocoTest, AttachPlugin) {
std::array<char, 1000> err;
mjSpec* parent = mj_parseXMLString(xml_plugin_1, 0, err.data(), err.size());
ASSERT_THAT(parent, NotNull()) << err.data();
@@ -316,7 +316,7 @@ TEST_F(PluginTest, AttachPlugin) {
mj_deleteSpec(spec_3);
}
TEST_F(PluginTest, DetachPlugin) {
TEST_F(MujocoTest, DetachPlugin) {
std::array<char, 1000> err;
mjSpec* parent = mj_parseXMLString(xml_plugin_1, 0, err.data(), err.size());
ASSERT_THAT(parent, NotNull()) << err.data();
@@ -342,7 +342,7 @@ TEST_F(PluginTest, DetachPlugin) {
mj_deleteSpec(child);
}
TEST_F(PluginTest, AttachExplicitPlugin) {
TEST_F(MujocoTest, AttachExplicitPlugin) {
static constexpr char xml_parent[] = R"(
<mujoco model="MuJoCo Model">
<worldbody>
@@ -396,7 +396,7 @@ TEST_F(PluginTest, AttachExplicitPlugin) {
mj_deleteModel(model);
}
TEST_F(PluginTest, ReplicatePlugin) {
TEST_F(MujocoTest, ReplicatePlugin) {
static constexpr char xml[] = R"(
<mujoco>
<extension>
@@ -429,7 +429,7 @@ TEST_F(PluginTest, ReplicatePlugin) {
mj_deleteModel(model);
}
TEST_F(PluginTest, ReplicateExplicitPlugin) {
TEST_F(MujocoTest, ReplicateExplicitPlugin) {
static constexpr char xml[] = R"(
<mujoco>
<extension>
@@ -484,7 +484,7 @@ TEST_F(MujocoTest, RecompileFails) {
mj_deleteSpec(spec);
}
TEST_F(PluginTest, ModifyShellInertiaFails) {
TEST_F(MujocoTest, ModifyShellInertiaFails) {
static constexpr char xml[] = R"(
<mujoco>
<asset>
@@ -515,7 +515,7 @@ TEST_F(PluginTest, ModifyShellInertiaFails) {
}
// ------------------- test recompilation multiple files -----------------------
TEST_F(PluginTest, RecompileCompare) {
TEST_F(MujocoTest, RecompileCompare) {
mjtNum tol = 0;
std::string field = "";
@@ -606,7 +606,7 @@ TEST_F(PluginTest, RecompileCompare) {
}
}
TEST_F(PluginTest, RecompileEdit) {
TEST_F(MujocoTest, RecompileEdit) {
static constexpr char xml[] = R"(
<mujoco>
<worldbody>
@@ -640,7 +640,7 @@ TEST_F(PluginTest, RecompileEdit) {
// ------------------- test cache with modified assets -------------------------
TEST_F(PluginTest, RecompileCompareObjCache) {
TEST_F(MujocoTest, RecompileCompareObjCache) {
static constexpr char xml[] = R"(
<mujoco>
<asset>
@@ -716,7 +716,7 @@ static constexpr uint8_t tex2[] = {
0x82
};
TEST_F(PluginTest, RecompileComparePngCache) {
TEST_F(MujocoTest, RecompileComparePngCache) {
static constexpr char xml[] = R"(
<mujoco>
<asset>
@@ -753,7 +753,7 @@ TEST_F(PluginTest, RecompileComparePngCache) {
mj_deleteVFS(vfs.get());
}
TEST_F(PluginTest, DisableCache) {
TEST_F(MujocoTest, DisableCache) {
static constexpr char xml[] = R"(
<mujoco>
<asset>
@@ -791,7 +791,7 @@ TEST_F(PluginTest, DisableCache) {
// -------------------------------- test textures ------------------------------
TEST_F(PluginTest, TextureFromBuffer) {
TEST_F(MujocoTest, TextureFromBuffer) {
mjSpec* spec = mj_makeSpec();
mjsTexture* t1 = mjs_addTexture(spec);