Skip to content

Commit

Permalink
RenderMan ModuleTest : Check we can open GUI without RenderMan
Browse files Browse the repository at this point in the history
  • Loading branch information
johnhaddon committed Feb 27, 2025
1 parent a40f76b commit ad4881e
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
22 changes: 22 additions & 0 deletions python/GafferRenderManTest/ModuleTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
#
##########################################################################

import os
import subprocess

import Gaffer
import GafferTest

class ModuleTest( GafferTest.TestCase ) :
Expand All @@ -43,5 +47,23 @@ def testDoesNotImportUI( self ) :
self.assertModuleDoesNotImportUI( "GafferRenderMan" )
self.assertModuleDoesNotImportUI( "GafferRenderManTest" )

def testCanLoadGUIConfigsWithoutRenderMan( self ) :

# Start a subprocess without RMANTREE set, and without the side-effects
# of it having been set when our wrapper ran earlier. And in that subprocess,
# check that we can still load the GUI configs cleanly.

env = os.environ.copy()
for var in ( "RMANTREE", "PYTHONPATH", "LD_LIBRARY_PATH", "DYLD_LIBRARY_PATH", "GAFFER_STARTUP_PATHS" ) :
env.pop( var, None )

try :
subprocess.check_output(
[ str( Gaffer.executablePath() ), "test", "GafferUITest.TestCase.assertCanLoadGUIConfigs" ],
env = env, stderr = subprocess.STDOUT
)
except subprocess.CalledProcessError as e :
self.fail( e.output )

if __name__ == "__main__":
unittest.main()
5 changes: 5 additions & 0 deletions python/GafferUITest/TestCase.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,11 @@ def assertNodeUIsHaveExpectedLifetime( self, module ) :
del script
self.assertIsNone( weakScript() )

def assertCanLoadGUIConfigs( self ) :

app = Gaffer.Application()
app._executeStartupFiles( "gui" )

@staticmethod
def __widgetInstances() :

Expand Down

0 comments on commit ad4881e

Please sign in to comment.