[vtk-developers] New testing utility: vtkPermuteOptions
allison.vacanti at kitware.com
Fri Jan 19 06:59:49 EST 2018
Firstly, I'm so happy that we've enabled C++11 in VTK :-)
I have a merge request for a new testing utility that you may find useful.
While adding support for bit arrays to the XML writers, I needed to make
sure that the new functionality worked no matter which combination of
writer settings were used (byte order, data mode, compression, etc).
To make this easier, I added a class template that will do exactly that --
you specify options and possible values, and vtkPermuteOptions will
simplify testing all possible combinations of these, e.g.
// vtkPermuteOptions is templated on the class that gets configured:
// Add option ByteOrder with values BigEndian and LittleEndian
// in separate AddOptionValue calls:
// Add option CompressorType with values NONE, ZLIB, and LZ4
// in a single AddOptionValues call:
// Generate the permutation list:
// Loop through all combinations of options
// Apply the current option permutation to a vtkXMLWriter object:
vtkXMLWriter *writer = ...;
// Testing code:
std::cout << "Testing " << config.GetCurrentPermutationName() << "\n";
In this example, runTest will be called 6 times, while varying the
Test Iteration ByteOrder CompressorType
-------------- --------- --------------
1 BigEndian NONE
2 BigEndian ZLIB
3 BigEndian LZ4
4 LittleEndian NONE
5 LittleEndian ZLIB
6 LittleEndian LZ4
I figured I'd mention this here, since I've found myself wanting this
capability several times over the years and thought it may be of general
interest. The merge request is up here:
Also, I'm open to a name change if anyone wants to flex their knowledge of
mathematics ;) I'm not 100% sure that "permutation" is the best name for
this sort of operation.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the vtk-developers