From: pixar-oss Date: Fri, 12 Jan 2024 18:40:49 +0000 (-0800) Subject: Updating the testPcpMuseum tests so that the clean up step, where X-Git-Tag: accepted/tizen/unified/x/20250428.070456~5^2~70 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1e989d27977cf23f32a76f5d4bade274295d199a;p=platform%2Fcore%2Fuifw%2FOpenUSD.git Updating the testPcpMuseum tests so that the clean up step, where 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) --- diff --git a/pxr/usd/pcp/CMakeLists.txt b/pxr/usd/pcp/CMakeLists.txt index 0f6005eda..a4376f0a8 100644 --- a/pxr/usd/pcp/CMakeLists.txt +++ b/pxr/usd/pcp/CMakeLists.txt @@ -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 ) diff --git a/pxr/usd/pcp/testenv/testPcpCompositionResults.py b/pxr/usd/pcp/testenv/testPcpCompositionResults.py index df3e26081..4ac3af6bc 100644 --- a/pxr/usd/pcp/testenv/testPcpCompositionResults.py +++ b/pxr/usd/pcp/testenv/testPcpCompositionResults.py @@ -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 = {} diff --git a/pxr/usd/pcp/testenv/testPcpMuseum_ErrorConnectionPermissionDenied.testenv/ErrorConnectionPermissionDenied/baseline/compositionErrors_ErrorConnectionPermissionDenied_pcp.txt b/pxr/usd/pcp/testenv/testPcpMuseum_ErrorConnectionPermissionDenied.testenv/ErrorConnectionPermissionDenied/baseline/compositionErrors_ErrorConnectionPermissionDenied_pcp.txt index 9f341a193..b83995540 100644 --- a/pxr/usd/pcp/testenv/testPcpMuseum_ErrorConnectionPermissionDenied.testenv/ErrorConnectionPermissionDenied/baseline/compositionErrors_ErrorConnectionPermissionDenied_pcp.txt +++ b/pxr/usd/pcp/testenv/testPcpMuseum_ErrorConnectionPermissionDenied.testenv/ErrorConnectionPermissionDenied/baseline/compositionErrors_ErrorConnectionPermissionDenied_pcp.txt @@ -7,13 +7,13 @@ The relationship target from < ------------------------------------------------------------------------ Errors while composing -The relationship target from 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 from 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 from 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 from 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 -The relationship target from 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. diff --git a/pxr/usd/pcp/testenv/testPcpMuseum_ErrorOwner.testenv/ErrorOwner/baseline/compositionErrors_ErrorOwner_pcp.txt b/pxr/usd/pcp/testenv/testPcpMuseum_ErrorOwner.testenv/ErrorOwner/baseline/compositionErrors_ErrorOwner_pcp.txt index e37a12f5d..e0dffdcd7 100644 --- a/pxr/usd/pcp/testenv/testPcpMuseum_ErrorOwner.testenv/ErrorOwner/baseline/compositionErrors_ErrorOwner_pcp.txt +++ b/pxr/usd/pcp/testenv/testPcpMuseum_ErrorOwner.testenv/ErrorOwner/baseline/compositionErrors_ErrorOwner_pcp.txt @@ -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@ diff --git a/pxr/usd/pcp/testenv/testPcpMuseum_ImpliedAndAncestralInherits.testenv/baseline/compositionResults_ImpliedAndAncestralInherits_graph.txt b/pxr/usd/pcp/testenv/testPcpMuseum_ImpliedAndAncestralInherits.testenv/baseline/compositionResults_ImpliedAndAncestralInherits_graph.txt index 3e760854a..f92d83033 100644 --- a/pxr/usd/pcp/testenv/testPcpMuseum_ImpliedAndAncestralInherits.testenv/baseline/compositionResults_ImpliedAndAncestralInherits_graph.txt +++ b/pxr/usd/pcp/testenv/testPcpMuseum_ImpliedAndAncestralInherits.testenv/baseline/compositionResults_ImpliedAndAncestralInherits_graph.txt @@ -32,7 +32,7 @@ Node 1: Type: reference DependencyType: ancestral, non-virtual Source path: - Source layer stack: @Group.sdf@ + Source layer stack: @ImpliedAndAncestralInherits/Group.sdf@ Target path: Target layer stack: @ImpliedAndAncestralInherits/root.sdf@ Map to parent: @@ -53,9 +53,9 @@ Node 2: Type: reference DependencyType: ancestral, non-virtual Source path: - Source layer stack: @CharGroupRig.sdf@ + Source layer stack: @ImpliedAndAncestralInherits/CharGroupRig.sdf@ Target path: - 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: - Source layer stack: @CharGroupRig.sdf@ + Source layer stack: @ImpliedAndAncestralInherits/CharGroupRig.sdf@ Target path: - 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: - CharGroupRig.sdf - @CharGroupRig.sdf@ + CharGroupRig.sdf - @ImpliedAndAncestralInherits/CharGroupRig.sdf@