Skip to content

Commit

Permalink
Fixes for testRmanOslParser
Browse files Browse the repository at this point in the history
Set RMAN_SHADERPATH to the location of the OSL shaders used
by the test. These are typically found automatically by the
rmanDiscovery plugin by looking relative to the hdPrmanLoader
plugin, which is installed in <inst>/plugin. However, in the
monolithic build this plugin is embedded in the single shared
library, which is installed in <inst>/lib. This breaks the
automatic discovery, so we need to hard-code the path to
the shaders instead.

Also remove unnecessary quotes from env setting; these quotes
were being passed all the way through to rmanDiscovery causing
incorrect search paths.

Fixes #1396

(Internal change: 2131436)
  • Loading branch information
sunyab authored and pixar-oss committed Dec 23, 2020
1 parent 2ef22c8 commit 9a05df5
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions third_party/renderman-23/plugin/rmanOslParser/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,15 @@ pxr_plugin(rmanOslParser
plugInfo.json
)

# Need to set RMANTREE environment variable when running tests.
# Need to set RMANTREE and RMAN_SHADERPATH environment variable when running
# tests.
#
# XXX: RMAN_SHADERPATH is only necessary for the monolithic build; in all
# other cases, the shaders accessed by the test are automatically found
# relative to libHdPrmanLoader. We may be able to remove this if we made
# it so this library wasn't embedded in the monolithic library.
get_filename_component(RMANTREE_PATH "${RENDERMAN_INCLUDE_DIR}/.." ABSOLUTE)
get_filename_component(RMANSHADER_PATH "${CMAKE_INSTALL_PREFIX}/plugin/usd/resources/shaders" ABSOLUTE)

pxr_test_scripts(
testenv/testRmanOslParser.py
Expand All @@ -39,6 +46,7 @@ pxr_register_test(testRmanOslParser
COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testRmanOslParser"
EXPECTED_RETURN_CODE 0
ENV
RMANTREE="${RMANTREE_PATH}"
RMANTREE=${RMANTREE_PATH}
RMAN_SHADERPATH=${RMANSHADER_PATH}
)

0 comments on commit 9a05df5

Please sign in to comment.