Commit bdbd8b01 authored by Sankhesh Jhaveri's avatar Sankhesh Jhaveri 💬

Allow VTK python test scripts to call Start() on the interactor

This allows the python test scripts to work as typical VTK python
scripts
parent bfae51ba
......@@ -10,18 +10,27 @@ for i in range(2, len(sys.argv)):
sys.path = sys.path + [sys.argv[i+1]]
import vtk
import math
#these are the modules that define methods/variables
#used by many scripts. We just include them always
from backdrop import *
from mccases import *
import expr
import catch
import info
import expr
import file
import info
import math
from vtk.util.colors import *
# Mock class that overrides the Start() method from vtkRenderWindowInteractor
# to do nothing. This allows VTK's python tests to be standard VTK scripts that
# call Start() on the interactor.
class vtkTestingInteractor(vtk.vtkRenderWindowInteractor):
def Start(self):
pass
#implementation for lindex.
def lindex(list, index):
if type(list) == type("string"):
......@@ -85,6 +94,9 @@ for arg in sys.argv[2:]:
VTK_DATA_ROOT = rtTester.GetDataRoot()
if rtTester.IsInteractiveModeSpecified() == 0:
vtk.vtkRenderWindowInteractor = vtkTestingInteractor
# load in the script
test_script = sys.argv[1]
......@@ -127,10 +139,6 @@ if rtTester.IsValidImageSpecified() != 0:
imgWin.Render()
rtResult = rtTester.RegressionTest(threshold)
if rtTester.IsInteractiveModeSpecified() != 0:
if "iren" in local_variables_dict:
iren.Start()
if rtResult == 0:
sys.exit(1)
sys.exit(0)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment