Updating the testPcpMuseum tests so that the clean up step, where
authorpixar-oss <pixar-oss@users.noreply.github.com>
Fri, 12 Jan 2024 18:40:49 +0000 (10:40 -0800)
committerpixar-oss <pixar-oss@users.noreply.github.com>
Fri, 12 Jan 2024 18:50:49 +0000 (10:50 -0800)
absolute paths to the test run directory are made relative in the test
output, happens directly in the testPcpCompositionResults script.

This requires baseline updates to a few tests as the the original
cleanup step was sometimes deleting more output text than
necessary.

(Internal change: 2311459)

pxr/usd/pcp/CMakeLists.txt
pxr/usd/pcp/testenv/testPcpCompositionResults.py
pxr/usd/pcp/testenv/testPcpMuseum_ErrorConnectionPermissionDenied.testenv/ErrorConnectionPermissionDenied/baseline/compositionErrors_ErrorConnectionPermissionDenied_pcp.txt
pxr/usd/pcp/testenv/testPcpMuseum_ErrorOwner.testenv/ErrorOwner/baseline/compositionErrors_ErrorOwner_pcp.txt
pxr/usd/pcp/testenv/testPcpMuseum_ImpliedAndAncestralInherits.testenv/baseline/compositionResults_ImpliedAndAncestralInherits_graph.txt

index 0f6005eda475d4e0ccecd8d6df36b55d9d70b577..a4376f0a87b5ff896f95720d8aa96015845736da 100644 (file)
@@ -1187,7 +1187,6 @@ pxr_register_test(testPcpMuseum_ImpliedAndAncestralInherits_graph
     TESTENV testPcpMuseum_ImpliedAndAncestralInherits
     COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testPcpCompositionResults --dumpPath /World/CharGroup/Sim/includes/Hand/Geom --dumpMaps ImpliedAndAncestralInherits/root.sdf" 
     STDOUT_REDIRECT compositionResults_ImpliedAndAncestralInherits_graph.txt
-    CLEAN_OUTPUT "[^@]*/ImpliedAndAncestralInherits/"
     DIFF_COMPARE compositionResults_ImpliedAndAncestralInherits_graph.txt 
 )
 
index df3e260812f0c7ac0597ee19549af6317bb63c29..4ac3af6bca4b51de9d2c30c54ea321464bd7cf28 100644 (file)
@@ -73,11 +73,19 @@ dumpPath = Sdf.Path(args.dumpPathStr) if args.dumpPathStr else Sdf.Path()
 
 Work.SetMaximumConcurrencyLimit()
 
+# Error messages and dump strings can contain absolute paths to layers which
+# change depending on where the this test command is run. This cleans out the
+# absolute test run path from these strings so that baseline compares will work
+# regardless of where this is run. 
+def CleanTestRunPaths(msg):
+    cwd = os.getcwd().replace('\\', '/') + '/'
+    return re.compile(re.escape(cwd), re.IGNORECASE).sub('', msg)
+
 def PrintErrorMessage(errorFile, msg):
     if errorFile:
-        print(msg, file=errorFile)
+        print(CleanTestRunPaths(msg), file=errorFile)
     else:
-        print(msg, file=sys.stderr)
+        print(CleanTestRunPaths(msg), file=sys.stderr)
 
 def PrintErrors(errorFile, errors):
     global hadError
@@ -198,7 +206,7 @@ for layerPath in args.layer:
 
         # Optionally dump the index for this path.
         if primPath == dumpPath:
-            print(primIndex.DumpToString(args.dumpMaps))
+            print(CleanTestRunPaths(primIndex.DumpToString(args.dumpMaps)))
 
         propStackMap = {} 
         targetsMap = {}
index 9f341a193f8bd408ffa2efce074f25ca7496f894..b8399554071febacc4bcd5965caa793d46bf855a 100644 (file)
@@ -7,13 +7,13 @@ The relationship target </PermissionsAcrossReferences.privateAttrFromRef> from <
 ------------------------------------------------------------------------
 Errors while composing </PermissionsAcrossInherits/Instance>
 
-The relationship target <ErrorConnectionPermissionDenied/ref.sdf@ targets an object that is private on the far side of a reference or inherit.  This target will be ignored.
-The relationship target <ErrorConnectionPermissionDenied/ref.sdf@ targets an object that is private on the far side of a reference or inherit.  This target will be ignored.
+The relationship target </ReferenceWithLocalClass/Instance/PrivatePrimFromClass> from </ReferenceWithLocalClass/Instance.relInInstance> in layer @ErrorConnectionPermissionDenied/ref.sdf@ targets an object that is private on the far side of a reference or inherit.  This target will be ignored.
+The relationship target </ReferenceWithLocalClass/Instance.privateAttrFromClass> from </ReferenceWithLocalClass/Instance.relInInstance> in layer @ErrorConnectionPermissionDenied/ref.sdf@ targets an object that is private on the far side of a reference or inherit.  This target will be ignored.
 The relationship target </PermissionsAcrossInherits/Instance/PrivatePrimFromClass> from </PermissionsAcrossInherits/Instance.relInRootInstance> in layer @ErrorConnectionPermissionDenied/root.sdf@ targets an object that is private on the far side of a reference or inherit.  This target will be ignored.
 The relationship target </PermissionsAcrossInherits/Instance.privateAttrFromClass> from </PermissionsAcrossInherits/Instance.relInRootInstance> in layer @ErrorConnectionPermissionDenied/root.sdf@ targets an object that is private on the far side of a reference or inherit.  This target will be ignored.
 
 ------------------------------------------------------------------------
 Errors while composing </CulledPermissions_3>
 
-The relationship target <ErrorConnectionPermissionDenied/culled_stable.sdf@ targets an object that is private on the far side of a reference or inherit.  This target will be ignored.
+The relationship target </CulledModel/sim/CollisionRig/FiztCollBody> from </CulledModel.colliders> in layer @ErrorConnectionPermissionDenied/culled_stable.sdf@ targets an object that is private on the far side of a reference or inherit.  This target will be ignored.
 
index e37a12f5dd66046720942d2983926d94032c44fa..e0dffdcd78dec84b5905547921228e2216c50254 100644 (file)
@@ -1,5 +1,5 @@
 ------------------------------------------------------------------------
 Errors while computing Layer Stack
 
-The following sublayers for layer @ErrorOwner/root.sdf@ have the same owner 'foo' @ErrorOwner/stronger.sdf@, @ErrorOwner/owned.sdf@
+The following sublayers for layer @ErrorOwner/root.sdf@ have the same owner 'foo': @ErrorOwner/stronger.sdf@, @ErrorOwner/owned.sdf@
 
index 3e760854af7d313808af50409af83a903cf5ebda..f92d83033ad34e8e6f75fab567dee97e51767fa6 100644 (file)
@@ -32,7 +32,7 @@ Node 1:
     Type:                     reference
     DependencyType:           ancestral, non-virtual
     Source path:              </CharGroup/Sim/includes/Hand/Geom>
-    Source layer stack:       @Group.sdf@
+    Source layer stack:       @ImpliedAndAncestralInherits/Group.sdf@
     Target path:              </World/CharGroup/Sim/includes/Hand/Geom>
     Target layer stack:       @ImpliedAndAncestralInherits/root.sdf@
     Map to parent:
@@ -53,9 +53,9 @@ Node 2:
     Type:                     reference
     DependencyType:           ancestral, non-virtual
     Source path:              </CHARGROUP/Sim/includes/Hand/Geom>
-    Source layer stack:       @CharGroupRig.sdf@
+    Source layer stack:       @ImpliedAndAncestralInherits/CharGroupRig.sdf@
     Target path:              </CharGroup/Sim/includes/Hand/Geom>
-    Target layer stack:       @Group.sdf@
+    Target layer stack:       @ImpliedAndAncestralInherits/Group.sdf@
     Map to parent:
         /CHARGROUP -> /CharGroup
     Map to root:
@@ -74,9 +74,9 @@ Node 3:
     Type:                     inherit
     DependencyType:           ancestral, non-virtual
     Source path:              </_class_SimHand/Geom>
-    Source layer stack:       @CharGroupRig.sdf@
+    Source layer stack:       @ImpliedAndAncestralInherits/CharGroupRig.sdf@
     Target path:              </CHARGROUP/Sim/includes/Hand/Geom>
-    Target layer stack:       @CharGroupRig.sdf@
+    Target layer stack:       @ImpliedAndAncestralInherits/CharGroupRig.sdf@
     Map to parent:
         / -> /
         /_class_SimHand -> /CHARGROUP/Sim/includes/Hand
@@ -93,7 +93,7 @@ Node 3:
     Has specs:                TRUE
     Has symmetry:             FALSE
     Prim stack:
-      </_class_SimHand/Geom> CharGroupRig.sdf - @CharGroupRig.sdf@
+      </_class_SimHand/Geom> CharGroupRig.sdf - @ImpliedAndAncestralInherits/CharGroupRig.sdf@