Skip to content

Commit d7f4e8a

Browse files
deboisjclaude
andcommitted
Decouple old tests from shared LE
876036 -0400 Merge remote-tracking branch 'upstream/dev' into deboisj/unify_layer_editor_review kQACksGu6ycD7dV7/lRp4Guvvj KVCsT9UwEthfdkPDMfa7G3i+9GSacK733THUcJppZK+4DM2m8PbSiP0pj/dSaElf iaICFZ7H2KJ6tTashv3bQPy6Z7mn4slht5L+66l+D4rWifT8QB1CXj2z2cgZ+2NX oc1LH6nKO6HKmq8crOB63Yb8O81jLOWCJoYt40nrlxy1SWqIJpMNnV2mj+1xAnUI 9n1h3qJb4+Jauu4zH+JPds/dewJ+3sLwKSF5q8BdLb8XmHckHG2ajvXmpZAJg6Rk vtkQDip8Viem0NpWOsVRVuQxOeqLs1UXhZt5e3bZ5txHR5L5PiHeb0rrphZ7b57w 50zBFPlKnP/+noIbMBtPBSUkw9B0lQFNVvxjamQic2Zga23J5+dcJ1Qf9J1tVbf+ hDOY1r3vxFU1PnDPvJjTgsA0ATH+P33Z1wQ4lYNaENo2iT+nbccq/fOusSNzsBdl iK2auWyxHX4P21ZpsZlICRgSkUn68Ncn0dJIUA6grewUAGxoBGkGHQ17FTTxWtXe XaZ3WpikFeNcRS89DayGpcjnj9UzSco2L0ZrudCLh/ltNDrxlk4tpQQrMep+0aI+ B/oIBncZS8y4IZAKdDm5pqJtGaYulqwYHAXL41QyAv/QEg+sA20KLSRKVIaQz7CK kq12Y3YgiDpN7fbCmJx/ =2NPd -----END PGP SIGNATURE----- Merge pull request #4651 from Autodesk/barbalt/dev/EMSUSD-3311-remove-opinion EMSUSD-3311 - Add remove opinion + undoENEITEM_HAS_METADATA is no…both unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> hropic.com>
1 parent 7bf312b commit d7f4e8a

8 files changed

Lines changed: 27 additions & 80 deletions

File tree

lib/usd/ui/layerEditor/mayaQtUtils.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818

1919
#include "mayaLayerEditorUi.h"
2020

21+
#if defined(MAYAUSD_USE_SHARED_LAYER_EDITOR)
2122
#include <layerEditorDCCFunctions.h>
23+
#endif
2224

2325
#include <maya/MQtUtil.h>
2426

test/lib/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,13 +163,15 @@ endforeach()
163163

164164
#
165165
# -----------------------------------------------------------------------------
166-
# Shared usdLayerEditor component tests (C++ GTests + Maya Python interactive test).
166+
# Shared usdLayerEditor component tests (C++ GTests + UFE commands python tests).
167167
# -----------------------------------------------------------------------------
168168
add_subdirectory(usdLayerEditor)
169169

170170
#
171171
# -----------------------------------------------------------------------------
172172
# Old layer editor parity tests — temporary, deleted when old editor is retired.
173+
# Reuse the shared layer editor test sources against the old editor; coverage is
174+
# lesser than the new editor suite.
173175
# -----------------------------------------------------------------------------
174176
add_subdirectory(oldUsdLayerEditor)
175177

test/lib/oldUsdLayerEditor/CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#
1616

1717
# Old layer editor parity test suite. Temporary — deleted when the old editor
18-
# is retired. See cpp/PARITY_STATUS.md for test coverage details.
18+
# is retired.
1919

2020
add_subdirectory(cpp)
2121

@@ -27,8 +27,6 @@ mayaUsd_add_test(${target}
2727
"LD_LIBRARY_PATH=${ADDITIONAL_LD_LIBRARY_PATH}"
2828
"MAYA_PLUG_IN_PATH=${CMAKE_INSTALL_PREFIX}/lib/maya"
2929
)
30-
set_property(TEST ${target} APPEND PROPERTY LABELS MayaUsdOldLEParity)
31-
3230
install(FILES testOldLayerEditorParity.py
3331
DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/tests
3432
)

test/lib/oldUsdLayerEditor/cpp/CMakeLists.txt

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,7 @@ set(CMAKE_AUTORCC ON)
2222
set(NEW_LE_TEST_CPP
2323
${CMAKE_CURRENT_SOURCE_DIR}/../../usdLayerEditor/cpp)
2424

25-
# layerEditorDCCFunctions.h lives in the shared lib; the *Logic.cpp sources use
26-
# ScopedLayerEditorDCCFunctions which includes it transitively.
27-
set(NEW_LE_LIB
28-
${CMAKE_CURRENT_SOURCE_DIR}/../../../../lib/usdLayerEditor/lib)
29-
30-
# ── Sources ────────────────────────────────────────────────────────────────────
25+
# Sources
3126
set(OLD_LE_OWN_SOURCES
3227
stubCommandHook.cpp
3328
stubSessionState.cpp
@@ -65,12 +60,6 @@ set(OLD_LE_SHARED_LOGIC_SOURCES
6560
${NEW_LE_TEST_CPP}/testUsdSyntaxHighlighterLogic.cpp
6661
)
6762

68-
# layerEditorDCCFunctions is compiled directly (not via UsdLayerEditorLib link)
69-
# to keep the registry self-contained inside this test DLL, avoiding ODR issues.
70-
set(DCC_FN_SOURCES
71-
${NEW_LE_LIB}/layerEditorDCCFunctions.cpp
72-
)
73-
7463
# Legacy widget sources compiled directly into this test DLL. This gives the
7564
# test a self-contained copy of the old editor, avoiding ODR conflicts with
7665
# UsdLayerEditorLib, which exports the new editor's versions of the same classes.
@@ -97,18 +86,20 @@ set(LEGACY_SOURCES
9786
${CMAKE_SOURCE_DIR}/lib/usd/ui/layerEditor/warningDialogs.cpp
9887
)
9988

89+
# The legacy layerEditorWidget.cpp above opens the edit-forward dialog, so its
90+
# definition must be compiled in when edit-forward is available; exercised by
91+
# the shared testEFModeLogic.cpp cases.
10092
if(AdskUsdEditForward_FOUND)
10193
list(APPEND LEGACY_SOURCES
10294
${CMAKE_SOURCE_DIR}/lib/usd/ui/editForward/editForwardDialog.cpp)
10395
endif()
10496

105-
# ── Target ─────────────────────────────────────────────────────────────────────
97+
# Target
10698
set(TARGET_NAME mayaUsdOldLayerEditorTests)
10799

108100
add_library(${TARGET_NAME} SHARED
109101
${OLD_LE_OWN_SOURCES}
110102
${OLD_LE_SHARED_LOGIC_SOURCES}
111-
${DCC_FN_SOURCES}
112103
${LEGACY_SOURCES}
113104
)
114105

@@ -134,14 +125,12 @@ target_compile_definitions(${TARGET_NAME}
134125
# Include path order is critical:
135126
# 1. OLD editor test dir FIRST — shim headers shadow new editor versions.
136127
# 2. NEW editor test dir SECOND — *Logic.h headers and testUtils.h.
137-
# 3. OLD editor lib THIRD — abstractCommandHook.h etc. must shadow the new lib versions.
138-
# 4. NEW editor lib LAST — layerEditorDCCFunctions.h, only resolved if not found above.
128+
# 3. OLD editor lib LAST — abstractCommandHook.h etc. must shadow the new lib versions.
139129
target_include_directories(${TARGET_NAME}
140130
PRIVATE
141131
${CMAKE_CURRENT_SOURCE_DIR}
142132
${NEW_LE_TEST_CPP}
143133
${CMAKE_SOURCE_DIR}/lib/usd/ui/layerEditor
144-
${NEW_LE_LIB}
145134
)
146135

147136
target_link_libraries(${TARGET_NAME}

test/lib/oldUsdLayerEditor/cpp/testFixture.cpp

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
//
1515
#include "testFixture.h"
1616

17-
#include "layerEditorDCCFunctions.h"
1817
#include "warningDialogs.h"
1918

2019
#include <QtWidgets/QApplication>
@@ -31,48 +30,6 @@ namespace UsdLayerEditor {
3130

3231
void LayerEditorTestFixture::SetUp()
3332
{
34-
EditForwardingFns ef;
35-
ef.supportsEditForwarding = [this]() { return _efSupported; };
36-
ef.echoEditForwarding = []() { return false; };
37-
ef.setEchoEditForwarding = [](bool) {};
38-
setEditForwardingFns(ef);
39-
40-
DccObjectFns dcc;
41-
dcc.isDccObjectStageIncoming = [this](const std::string&) { return _stageIncoming; };
42-
dcc.isDccObjectSharedStage = [this](const std::string&) { return _sharedStage; };
43-
setDccObjectFns(dcc);
44-
45-
ComponentFns component;
46-
component.isStageAComponent
47-
= [this](const std::string&) { return _isComponent; };
48-
component.isUnsavedComponent
49-
= [this](const PXR_NS::UsdStageRefPtr&) { return _isUnsavedComponent; };
50-
component.shouldDisplayComponentInitialSaveDialog
51-
= [](const PXR_NS::UsdStageRefPtr&, const std::string&) { return false; };
52-
component.saveComponent
53-
= [this](const PXR_NS::UsdStageRefPtr&, const std::string&) { ++_saveComponentCalls; };
54-
component.reloadComponent
55-
= [this](const std::string&) { ++_reloadComponentCalls; };
56-
component.moveComponent
57-
= [this](const std::string&, const std::string&, const std::string&) {
58-
return _moveComponentResult;
59-
};
60-
component.renameProxyShape
61-
= [](const std::string&, const std::string& name) { return std::string("|") + name; };
62-
component.captureSessionLayer
63-
= [](const std::string&) { return PXR_NS::SdfLayerRefPtr {}; };
64-
component.transferSessionLayer
65-
= [this](const PXR_NS::SdfLayerRefPtr&, const std::string&) { ++_transferSessionCalls; };
66-
component.setProxyRootLayerPath
67-
= [this](const std::string&, const std::string&, const PXR_NS::SdfLayerRefPtr&) {
68-
++_setProxyRootPathCalls;
69-
};
70-
setComponentFns(component);
71-
72-
SaveOptionFns saveOption;
73-
saveOption.confirmExistingFileSave = [this]() { return _confirmExistingFileSave; };
74-
setSaveOptionFns(saveOption);
75-
7633
setModalDialogTestHandler([this](const QString&, const QString&) {
7734
++_modalDialogCount;
7835
return _modalDialogAnswer;

test/lib/oldUsdLayerEditor/cpp/testFixture.h

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
//
1515
#pragma once
1616

17-
#include "scopedLayerEditorDCCFunctions.h"
1817
#include "stubCommandHook.h"
1918
#include "stubLayerEditorWindow.h"
2019
#include "stubSessionState.h"
@@ -49,35 +48,26 @@ class LayerEditorTestFixture : public ::testing::Test
4948
void setSharedStage(bool shared) { _sessionState._commandHookImpl._isSharedStage = shared; }
5049
void setStageIncoming(bool incoming) { _sessionState._commandHookImpl._isStageIncoming = incoming; }
5150

52-
// Members — names must match new editor's testFixture.h exactly
51+
// Members mirror the new editor's testFixture.h, named identically so the
52+
// shared *Logic.cpp sources compile unchanged. Only those the old editor
53+
// actually exercises are kept; members feeding the new editor's DCC registry
54+
// are referenced solely by MAYAUSD_OLD_LAYER_EDITOR-guarded test code.
5355
OldEditorStubSessionState _sessionState;
5456
std::unique_ptr<OldEditorStubLayerEditorWindow> _window;
5557
QMainWindow* _mainWindow { nullptr };
5658
LayerEditorWidget* _widget { nullptr };
5759

58-
bool _efSupported { false };
59-
bool _sharedStage { false };
60-
bool _stageIncoming { false };
61-
62-
bool _isComponent { false };
63-
bool _isUnsavedComponent { false };
64-
std::string _moveComponentResult;
65-
int _saveComponentCalls { 0 };
66-
int _reloadComponentCalls { 0 };
67-
int _transferSessionCalls { 0 };
68-
int _setProxyRootPathCalls { 0 };
60+
bool _isComponent { false };
61+
bool _isUnsavedComponent { false };
6962

7063
int _modalDialogCount { 0 };
7164
bool _modalDialogAnswer { true };
72-
bool _confirmExistingFileSave { false };
7365
// Real Maya proxy shape DAG paths, e.g. "|leTestXform0|leTestProxy0".
7466
// Set in SetUp, cleared in TearDown.
7567
std::string _proxyShapePaths[2];
7668
// Temp .usda files backing the proxy shapes — deleted in TearDown.
7769
std::string _tempStagePaths[2];
7870

79-
ScopedLayerEditorDCCFunctions _scopedDCCFunctions;
80-
8171
void setIsComponent(bool v) { _isComponent = v; }
8272
void setIsUnsavedComponent(bool v) { _isUnsavedComponent = v; }
8373
};

test/lib/usdLayerEditor/cpp/testLayerLogicUtilsLogic.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@
1515
// limitations under the License.
1616
//
1717
#include "customLayerData.h"
18+
#ifndef MAYAUSD_OLD_LAYER_EDITOR
19+
// Layers:: utilities live in UsdLayerEditorLib, which the old editor test binary
20+
// does not link; only the guarded LayersTest cases below use them.
1821
#include "layers.h"
22+
#endif
1923
#include "warningDialogs.h"
2024

2125
#include <pxr/base/tf/token.h>

test/lib/usdLayerEditor/cpp/testLayerTreeItemLogic.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,11 +398,16 @@ TEST_F(LayerTreeItemTest, IsIdenticalItem_DifferentLayerReturnsFalse)
398398
// (SessionState::saveLayerUI), which the stub records via _saveLayerCallCount.
399399
TEST_F(LayerTreeItemTest, SaveAnonymousLayer_NonComponentStage_UsesGenericPath)
400400
{
401+
#ifndef MAYAUSD_OLD_LAYER_EDITOR
402+
// Configures the new editor's component early-out to treat the stage as a
403+
// non-component. The old editor has no such early-out and ignores the DCC
404+
// registry, so this setup is omitted there (and the registry isn't linked).
401405
ScopedLayerEditorDCCFunctions guard;
402406
ComponentFns comp;
403407
comp.displayError = [](const std::string&) {};
404408
comp.isStageAComponent = [](const std::string&) { return false; };
405409
setComponentFns(comp);
410+
#endif
406411

407412
auto* item = itemAt(treeModel(), firstSublayerIndex());
408413
ASSERT_NE(item, nullptr);

0 commit comments

Comments
 (0)