Skip to content

Remove NO_RT requirement for Python vtkTest

David Gobbi requested to merge dgobbi/vtk:reduce-NO_RT-requirement into master

The NO_RT test option causes cmake to use -B baselinedir instead of -V testimage.png. It also causes the test script to be executed directly, instead of via the rtImageTest test driver, even though this is not explicitly stated in the documentation:

  • NO_RT: If NO_RT is specified, -B is passed instead of -V, only providing a baseline dir, assuming NO_VALID is not specified.

The goal of this MR is to make it so that Python test scripts that use Testing.vtkTest and Testing.main() will work regardless of whether they are executed directly, or whether they are executed via rtImageTest. This removes the need for the NO_RT option in almost all cases.

In order to run these tests without NO_RT, two changes were made to Testing:

  1. Before searching -B baselinedir for test images, the images passed with -V testimage.png are also checked, if they have the same basename as the desired image.
  2. More flexibility is provided for the test arg positions, allowing for rtImageTest.py testscript.py -arg1 x -arg2 y instead of strictly requiring testscript.py -arg1 x -arg2 y.

After this change, the only tests that absolutely require NO_RT are the ones that require the baselinedir rather than just one test image, i.e. the ones that require multiple baselines, or that require baselines that are not named after the test.

The benefit of this change is less frustration for people who wrote a test, but didn't add NO_RT and don't understand why their test doesn't work. The caveat is that leaving out the NO_RT means that rtImageTest is used unnecessarily for vtkTest-based tests.

Edited by David Gobbi

Merge request reports