From bb07fa0c78934b59c87eadb30e03f8ec8366f924 Mon Sep 17 00:00:00 2001 From: Sam Haves Date: Wed, 30 Apr 2025 08:43:18 -0700 Subject: [PATCH] Move Mujoco USD test fixture out of MJCF plugin directory and rename to test_utils. PiperOrigin-RevId: 753183581 Change-Id: Iedd6594ac679ca026f8af29c647d18ae93003a53 --- test/experimental/usd/plugins/mjcf/mjcf_file_format_test.cc | 4 +++- .../usd/{plugins/mjcf/fixture.cc => test_utils.cc} | 4 +++- .../experimental/usd/{plugins/mjcf/fixture.h => test_utils.h} | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) rename test/experimental/usd/{plugins/mjcf/fixture.cc => test_utils.cc} (96%) rename test/experimental/usd/{plugins/mjcf/fixture.h => test_utils.h} (99%) diff --git a/test/experimental/usd/plugins/mjcf/mjcf_file_format_test.cc b/test/experimental/usd/plugins/mjcf/mjcf_file_format_test.cc index fd6e2563..fb2a1a65 100644 --- a/test/experimental/usd/plugins/mjcf/mjcf_file_format_test.cc +++ b/test/experimental/usd/plugins/mjcf/mjcf_file_format_test.cc @@ -17,7 +17,7 @@ #include #include -#include "test/experimental/usd/plugins/mjcf/fixture.h" +#include "test/experimental/usd/test_utils.h" #include "test/fixture.h" #include #include @@ -56,6 +56,7 @@ TF_DEFINE_PRIVATE_TOKENS(_tokens, PXR_NAMESPACE_CLOSE_SCOPE namespace mujoco { +namespace usd { namespace { using pxr::SdfPath; @@ -730,4 +731,5 @@ TEST_F(MjcfSdfFileFormatPluginTest, TestPhysicsColliders) { } } // namespace +} // namespace usd } // namespace mujoco diff --git a/test/experimental/usd/plugins/mjcf/fixture.cc b/test/experimental/usd/test_utils.cc similarity index 96% rename from test/experimental/usd/plugins/mjcf/fixture.cc rename to test/experimental/usd/test_utils.cc index cc3362e0..8bfc30e0 100644 --- a/test/experimental/usd/plugins/mjcf/fixture.cc +++ b/test/experimental/usd/test_utils.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "test/experimental/usd/plugins/mjcf/fixture.h" +#include "test/experimental/usd/test_utils.h" #include @@ -28,6 +28,7 @@ #include #include namespace mujoco { +namespace usd { using pxr::SdfPath; @@ -61,4 +62,5 @@ void ExpectAttributeHasConnection(pxr::UsdStageRefPtr stage, const char* path, EXPECT_EQ(sources.size(), 1); EXPECT_EQ(sources[0], SdfPath(connection_path)); } +} // namespace usd } // namespace mujoco diff --git a/test/experimental/usd/plugins/mjcf/fixture.h b/test/experimental/usd/test_utils.h similarity index 99% rename from test/experimental/usd/plugins/mjcf/fixture.h rename to test/experimental/usd/test_utils.h index c31082d0..ec5e3de7 100644 --- a/test/experimental/usd/plugins/mjcf/fixture.h +++ b/test/experimental/usd/test_utils.h @@ -67,6 +67,7 @@ EXPECT_FALSE((stage)->GetAttributeAtPath(SdfPath(path)).HasValue()); namespace mujoco { +namespace usd { pxr::SdfLayerRefPtr LoadLayer( const std::string& xml, @@ -94,5 +95,6 @@ void ExpectAttributeEqual(pxr::UsdStageRefPtr stage, void ExpectAttributeHasConnection(pxr::UsdStageRefPtr stage, const char* path, const char* connection_path); +} // namespace usd } // namespace mujoco #endif // MUJOCO_TEST_EXPERIMENTAL_USD_PLUGINS_MJCF_FIXTURE_H_