diff --git a/data/baseline/contour-wedge.png b/data/baseline/contour-wedge.png deleted file mode 100644 index 55bb9045c..000000000 --- a/data/baseline/contour-wedge.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ab7462d094c75d92e7d034a748b5cd7cd353ecc8187e1b13de226a15c37ba11a -size 10310 diff --git a/data/baseline/contour-wedge0.png b/data/baseline/contour-wedge0.png new file mode 100644 index 000000000..66101432e --- /dev/null +++ b/data/baseline/contour-wedge0.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:74995441b8f0c0c19b16d45c489932958784bb3f32c65fd274985b3ecfcc87d6 +size 19885 diff --git a/data/baseline/contour-wedge1.png b/data/baseline/contour-wedge1.png new file mode 100644 index 000000000..cea43e5db --- /dev/null +++ b/data/baseline/contour-wedge1.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c1a54c159483076a2eed1f7cf8f8d947e6ec59dcfbd8ed41355e92cf052d344e +size 19884 diff --git a/data/baseline/point-transform.png b/data/baseline/point-transform0.png similarity index 100% rename from data/baseline/point-transform.png rename to data/baseline/point-transform0.png diff --git a/data/baseline/point-transform1.png b/data/baseline/point-transform1.png new file mode 100644 index 000000000..748f8260a --- /dev/null +++ b/data/baseline/point-transform1.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f369086fb38f92d4b0074af566872ce3876d65df8e2bc5fb0757c57a7449522f +size 28255 diff --git a/data/baseline/streamline.png b/data/baseline/streamline0.png similarity index 100% rename from data/baseline/streamline.png rename to data/baseline/streamline0.png diff --git a/data/baseline/streamline1.png b/data/baseline/streamline1.png new file mode 100644 index 000000000..35c2a6f50 --- /dev/null +++ b/data/baseline/streamline1.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b215997c33dfb26d6a949af55b8161b63a83e48f8f11d4733551a215cf085e15 +size 31588 diff --git a/data/baseline/surface-normals.png b/data/baseline/surface-normals.png deleted file mode 100644 index 11e5735b8..000000000 --- a/data/baseline/surface-normals.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:fd088f6851b05be6aade3ca60eb7e8214eed18b216ba70c9c76e936c461541f1 -size 52955 diff --git a/data/baseline/surface-normals0.png b/data/baseline/surface-normals0.png new file mode 100644 index 000000000..9e4923e85 --- /dev/null +++ b/data/baseline/surface-normals0.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:34698f0f8e0895745208f4e9f608cbd4faca6cfb0b25a1a984b117a4f53eea38 +size 46680 diff --git a/data/baseline/surface-normals1.png b/data/baseline/surface-normals1.png new file mode 100644 index 000000000..18d9f960d --- /dev/null +++ b/data/baseline/surface-normals1.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a16d182ccd5199a577d54386ab7f5f35c988848ef81bcb8d1f7001eb60b2e1a9 +size 46683 diff --git a/data/data/uniform/StreamlineTestDataSet.vtk b/data/data/uniform/StreamlineTestDataSet.vtk new file mode 100644 index 000000000..45c8788aa --- /dev/null +++ b/data/data/uniform/StreamlineTestDataSet.vtk @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a2c0b3788197a48a305fc049f54d66c94c20298e617ef06dbe4fe0c2043f7366 +size 3590 diff --git a/data/data/unstructured/PointTransformTestDataSet.vtk b/data/data/unstructured/PointTransformTestDataSet.vtk new file mode 100644 index 000000000..f5d0a1543 --- /dev/null +++ b/data/data/unstructured/PointTransformTestDataSet.vtk @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7191ea7dec00129cb262239a508aeba4bb9387e581adfa2049211f4514ee4130 +size 1020 diff --git a/data/data/unstructured/SplitSharpEdgesTestDataSet.vtk b/data/data/unstructured/SplitSharpEdgesTestDataSet.vtk new file mode 100644 index 000000000..7c200d879 --- /dev/null +++ b/data/data/unstructured/SplitSharpEdgesTestDataSet.vtk @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b7b7e73f60f3572e19178aa55fcd32cafb5c5823062241d28aa37d82b0031a2a +size 1145 diff --git a/data/data/unstructured/SurfaceNormalsTestDataSet.vtk b/data/data/unstructured/SurfaceNormalsTestDataSet.vtk new file mode 100644 index 000000000..6c02dac2f --- /dev/null +++ b/data/data/unstructured/SurfaceNormalsTestDataSet.vtk @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:90aed1ed3c3eba58f1b0b1573b09e8c024e48f5ca822e9f88b0c1ff6593a978f +size 693 diff --git a/vtkm/filter/testing/CMakeLists.txt b/vtkm/filter/testing/CMakeLists.txt index cd3ad2457..f468d541d 100644 --- a/vtkm/filter/testing/CMakeLists.txt +++ b/vtkm/filter/testing/CMakeLists.txt @@ -8,12 +8,6 @@ ## PURPOSE. See the above copyright notice for more information. ##============================================================================ -set(headers - MakeTestDataSet.h -) - -vtkm_declare_headers(${headers}) - set(unit_tests UnitTestCellAverageFilter.cxx UnitTestCellMeasuresFilter.cxx diff --git a/vtkm/filter/testing/MakeTestDataSet.h b/vtkm/filter/testing/MakeTestDataSet.h deleted file mode 100644 index fa912f1dc..000000000 --- a/vtkm/filter/testing/MakeTestDataSet.h +++ /dev/null @@ -1,175 +0,0 @@ -//============================================================================ -// Copyright (c) Kitware, Inc. -// All rights reserved. -// See LICENSE.txt for details. -// -// This software is distributed WITHOUT ANY WARRANTY; without even -// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -// PURPOSE. See the above copyright notice for more information. -//============================================================================ - -#ifndef vtk_m_filter_testing_MakeTestDataSet_h -#define vtk_m_filter_testing_MakeTestDataSet_h - -#include -#include -#include -#include -#include - -#include - -#include - -namespace vtkm -{ -namespace filter -{ -namespace testing -{ - -class MakeTestDataSet -{ -public: - // 3D explicit datasets - vtkm::cont::DataSet Make3DExplicitSimpleCube(); - - // Special test datasets - vtkm::cont::DataSet MakePointTransformTestDataSet(); - vtkm::cont::DataSet MakeStreamlineTestDataSet(const vtkm::Id3& dims, const vtkm::Vec3f& vec); -}; - -inline vtkm::cont::DataSet MakeTestDataSet::MakePointTransformTestDataSet() -{ - vtkm::cont::DataSet dataSet; - - std::vector coordinates; - const vtkm::Id dim = 5; - for (vtkm::Id j = 0; j < dim; ++j) - { - vtkm::FloatDefault z = - static_cast(j) / static_cast(dim - 1); - for (vtkm::Id i = 0; i < dim; ++i) - { - vtkm::FloatDefault x = - static_cast(i) / static_cast(dim - 1); - vtkm::FloatDefault y = (x * x + z * z) / 2.0f; - coordinates.push_back(vtkm::make_Vec(x, y, z)); - } - } - - vtkm::Id numCells = (dim - 1) * (dim - 1); - dataSet.AddCoordinateSystem( - vtkm::cont::make_CoordinateSystem("coordinates", coordinates, vtkm::CopyFlag::On)); - - vtkm::cont::CellSetExplicit<> cellSet; - cellSet.PrepareToAddCells(numCells, numCells * 4); - for (vtkm::Id j = 0; j < dim - 1; ++j) - { - for (vtkm::Id i = 0; i < dim - 1; ++i) - { - cellSet.AddCell(vtkm::CELL_SHAPE_QUAD, - 4, - vtkm::make_Vec( - j * dim + i, j * dim + i + 1, (j + 1) * dim + i + 1, (j + 1) * dim + i)); - } - } - cellSet.CompleteAddingCells(vtkm::Id(coordinates.size())); - - dataSet.SetCellSet(cellSet); - return dataSet; -} - -inline vtkm::cont::DataSet MakeTestDataSet::MakeStreamlineTestDataSet(const vtkm::Id3& dims, - const vtkm::Vec3f& vec) -{ - vtkm::Id numPoints = dims[0] * dims[1] * dims[2]; - - std::vector vectorField(static_cast(numPoints)); - for (std::size_t i = 0; i < static_cast(numPoints); i++) - vectorField[i] = vec; - - vtkm::cont::DataSetBuilderUniform dataSetBuilder; - - vtkm::cont::DataSet ds = dataSetBuilder.Create(dims); - ds.AddPointField("vector", vectorField); - - return ds; -} - -inline vtkm::cont::DataSet MakeTestDataSet::Make3DExplicitSimpleCube() -{ - vtkm::cont::DataSet dataSet; - vtkm::cont::DataSetBuilderExplicit dsb; - - const int nVerts = 8; - const int nCells = 6; - using CoordType = vtkm::Vec3f; - std::vector coords = { - CoordType(0, 0, 0), // 0 - CoordType(1, 0, 0), // 1 - CoordType(1, 0, 1), // 2 - CoordType(0, 0, 1), // 3 - CoordType(0, 1, 0), // 4 - CoordType(1, 1, 0), // 5 - CoordType(1, 1, 1), // 6 - CoordType(0, 1, 1) // 7 - }; - - //Connectivity - std::vector shapes; - std::vector numIndices; - for (size_t i = 0; i < 6; i++) - { - shapes.push_back(vtkm::CELL_SHAPE_QUAD); - numIndices.push_back(4); - } - - std::vector conn; - // Down face - conn.push_back(0); - conn.push_back(1); - conn.push_back(5); - conn.push_back(4); - // Right face - conn.push_back(1); - conn.push_back(2); - conn.push_back(6); - conn.push_back(5); - // Top face - conn.push_back(2); - conn.push_back(3); - conn.push_back(7); - conn.push_back(6); - // Left face - conn.push_back(3); - conn.push_back(0); - conn.push_back(4); - conn.push_back(7); - // Front face - conn.push_back(4); - conn.push_back(5); - conn.push_back(6); - conn.push_back(7); - // Back face - conn.push_back(0); - conn.push_back(3); - conn.push_back(2); - conn.push_back(1); - //Create the dataset. - dataSet = dsb.Create(coords, shapes, numIndices, conn, "coordinates"); - - vtkm::FloatDefault vars[nVerts] = { 10.1f, 20.1f, 30.2f, 40.2f, 50.3f, 60.3f, 70.3f, 80.3f }; - vtkm::FloatDefault cellvar[nCells] = { 100.1f, 200.2f, 300.3f, 400.4f, 500.5f, 600.6f }; - - dataSet.AddPointField("pointvar", vars, nVerts); - dataSet.AddCellField("cellvar", cellvar, nCells); - - return dataSet; -} - -} -} -} // namespace vtkm::filter::testing - -#endif //vtk_m_filter_testing_MakeTestDataSet_h diff --git a/vtkm/filter/testing/RegressionTestContourFilter.cxx b/vtkm/filter/testing/RegressionTestContourFilter.cxx index 2e4306bd6..b7d1307b3 100644 --- a/vtkm/filter/testing/RegressionTestContourFilter.cxx +++ b/vtkm/filter/testing/RegressionTestContourFilter.cxx @@ -51,9 +51,10 @@ void TestContourFilterWedge() M mapper; vtkm::rendering::Scene scene; auto view = vtkm::rendering::testing::GetViewPtr( - result, "gyroid", canvas, mapper, scene, colorTable, static_cast(0.075)); + result, "gyroid", canvas, mapper, scene, colorTable, static_cast(0.08)); - VTKM_TEST_ASSERT(vtkm::rendering::testing::test_equal_images(view, "contour-wedge.png")); + VTKM_TEST_ASSERT( + vtkm::rendering::testing::test_equal_images_matching_name(view, "contour-wedge.png")); } void TestContourFilter() diff --git a/vtkm/filter/testing/RegressionTestPointTransform.cxx b/vtkm/filter/testing/RegressionTestPointTransform.cxx index a734e6dd4..e0a769856 100644 --- a/vtkm/filter/testing/RegressionTestPointTransform.cxx +++ b/vtkm/filter/testing/RegressionTestPointTransform.cxx @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include @@ -33,8 +33,10 @@ void TestPointTransform() using C = vtkm::rendering::CanvasRayTracer; using V3 = vtkm::rendering::View3D; - vtkm::filter::testing::MakeTestDataSet makeTestData; - auto dataSet = makeTestData.MakePointTransformTestDataSet(); + auto pathname = + vtkm::cont::testing::Testing::DataPath("unstructured/PointTransformTestDataSet.vtk"); + vtkm::io::VTKDataSetReader reader(pathname); + vtkm::cont::DataSet dataSet = reader.ReadDataSet(); vtkm::filter::PointTransform pointTransform; pointTransform.SetOutputFieldName("translation"); @@ -56,7 +58,8 @@ void TestPointTransform() auto view = vtkm::rendering::testing::GetViewPtr( result, "pointvar", canvas, mapper, scene, colorTable, static_cast(0.05)); - VTKM_TEST_ASSERT(vtkm::rendering::testing::test_equal_images(view, "point-transform.png")); + VTKM_TEST_ASSERT( + vtkm::rendering::testing::test_equal_images_matching_name(view, "point-transform.png")); } } // namespace diff --git a/vtkm/filter/testing/RegressionTestSplitSharpEdges.cxx b/vtkm/filter/testing/RegressionTestSplitSharpEdges.cxx index 71ef8d8e4..741e6e798 100644 --- a/vtkm/filter/testing/RegressionTestSplitSharpEdges.cxx +++ b/vtkm/filter/testing/RegressionTestSplitSharpEdges.cxx @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include @@ -33,11 +33,10 @@ void TestSplitSharpEdges() using C = vtkm::rendering::CanvasRayTracer; using V3 = vtkm::rendering::View3D; - vtkm::filter::testing::MakeTestDataSet makeTestData; - vtkm::filter::SurfaceNormals surfaceNormalsFilter; - surfaceNormalsFilter.SetGenerateCellNormals(true); - vtkm::cont::DataSet dataSet = - surfaceNormalsFilter.Execute(makeTestData.Make3DExplicitSimpleCube()); + auto pathname = + vtkm::cont::testing::Testing::DataPath("unstructured/SplitSharpEdgesTestDataSet.vtk"); + vtkm::io::VTKDataSetReader reader(pathname); + auto dataSet = reader.ReadDataSet(); vtkm::filter::SplitSharpEdges splitSharpEdges; splitSharpEdges.SetFeatureAngle(89.0); diff --git a/vtkm/filter/testing/RegressionTestStreamline.cxx b/vtkm/filter/testing/RegressionTestStreamline.cxx index 77192a7b0..efe75f4ba 100644 --- a/vtkm/filter/testing/RegressionTestStreamline.cxx +++ b/vtkm/filter/testing/RegressionTestStreamline.cxx @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include @@ -34,10 +34,9 @@ void TestStreamline() using C = vtkm::rendering::CanvasRayTracer; using V3 = vtkm::rendering::View3D; - const vtkm::Id3 dims(5, 5, 5); - const vtkm::Vec3f vecX(1, 0, 0); - vtkm::filter::testing::MakeTestDataSet makeTestData; - auto dataSet = makeTestData.MakeStreamlineTestDataSet(dims, vecX); + auto pathname = vtkm::cont::testing::Testing::DataPath("uniform/StreamlineTestDataSet.vtk"); + vtkm::io::VTKDataSetReader reader(pathname); + vtkm::cont::DataSet dataSet = reader.ReadDataSet(); vtkm::cont::ArrayHandle seedArray = vtkm::cont::make_ArrayHandle({ vtkm::Particle(vtkm::Vec3f(.2f, 1.0f, .2f), 0), vtkm::Particle(vtkm::Vec3f(.2f, 2.0f, .2f), 1), @@ -75,7 +74,8 @@ void TestStreamline() auto view = vtkm::rendering::testing::GetViewPtr( result, "pointvar", canvas, mapper, scene, colorTable, static_cast(0.1)); - VTKM_TEST_ASSERT(vtkm::rendering::testing::test_equal_images(view, "streamline.png")); + VTKM_TEST_ASSERT( + vtkm::rendering::testing::test_equal_images_matching_name(view, "streamline.png")); } } // namespace diff --git a/vtkm/filter/testing/RegressionTestSurfaceNormals.cxx b/vtkm/filter/testing/RegressionTestSurfaceNormals.cxx index 1410e9e78..d981d9add 100644 --- a/vtkm/filter/testing/RegressionTestSurfaceNormals.cxx +++ b/vtkm/filter/testing/RegressionTestSurfaceNormals.cxx @@ -10,8 +10,8 @@ #include #include -#include #include +#include #include @@ -32,8 +32,13 @@ void TestSurfaceNormals() using C = vtkm::rendering::CanvasRayTracer; using V3 = vtkm::rendering::View3D; - vtkm::cont::testing::MakeTestDataSet makeTestData; - auto dataSet = makeTestData.Make3DExplicitDataSetPolygonal(); + // NOTE: This dataset stores a shape value of 7 for polygons. The + // VTKDataSetReader currently converts all polygons with 4 verticies to + // quads (shape 9). + auto pathname = + vtkm::cont::testing::Testing::DataPath("unstructured/SurfaceNormalsTestDataSet.vtk"); + vtkm::io::VTKDataSetReader reader(pathname); + auto dataSet = reader.ReadDataSet(); vtkm::filter::SurfaceNormals surfaceNormals; surfaceNormals.SetGeneratePointNormals(true); @@ -48,7 +53,8 @@ void TestSurfaceNormals() auto view = vtkm::rendering::testing::GetViewPtr( result, "pointvar", canvas, mapper, scene, colorTable, static_cast(0.05)); - VTKM_TEST_ASSERT(vtkm::rendering::testing::test_equal_images(view, "surface-normals.png")); + VTKM_TEST_ASSERT( + vtkm::rendering::testing::test_equal_images_matching_name(view, "surface-normals.png")); } } // namespace diff --git a/vtkm/filter/testing/UnitTestPointTransform.cxx b/vtkm/filter/testing/UnitTestPointTransform.cxx index b0efec184..768468688 100644 --- a/vtkm/filter/testing/UnitTestPointTransform.cxx +++ b/vtkm/filter/testing/UnitTestPointTransform.cxx @@ -10,7 +10,6 @@ #include #include -#include #include #include @@ -20,6 +19,47 @@ namespace { std::mt19937 randGenerator; +vtkm::cont::DataSet MakePointTransformTestDataSet() +{ + vtkm::cont::DataSet dataSet; + + std::vector coordinates; + const vtkm::Id dim = 5; + for (vtkm::Id j = 0; j < dim; ++j) + { + vtkm::FloatDefault z = + static_cast(j) / static_cast(dim - 1); + for (vtkm::Id i = 0; i < dim; ++i) + { + vtkm::FloatDefault x = + static_cast(i) / static_cast(dim - 1); + vtkm::FloatDefault y = (x * x + z * z) / 2.0f; + coordinates.push_back(vtkm::make_Vec(x, y, z)); + } + } + + vtkm::Id numCells = (dim - 1) * (dim - 1); + dataSet.AddCoordinateSystem( + vtkm::cont::make_CoordinateSystem("coordinates", coordinates, vtkm::CopyFlag::On)); + + vtkm::cont::CellSetExplicit<> cellSet; + cellSet.PrepareToAddCells(numCells, numCells * 4); + for (vtkm::Id j = 0; j < dim - 1; ++j) + { + for (vtkm::Id i = 0; i < dim - 1; ++i) + { + cellSet.AddCell(vtkm::CELL_SHAPE_QUAD, + 4, + vtkm::make_Vec( + j * dim + i, j * dim + i + 1, (j + 1) * dim + i + 1, (j + 1) * dim + i)); + } + } + cellSet.CompleteAddingCells(vtkm::Id(coordinates.size())); + + dataSet.SetCellSet(cellSet); + return dataSet; +} + void ValidatePointTransform(const vtkm::cont::CoordinateSystem& coords, const std::string fieldName, const vtkm::cont::DataSet& result, @@ -98,8 +138,7 @@ void TestPointTransform() { std::cout << "Testing PointTransform Worklet" << std::endl; - vtkm::filter::testing::MakeTestDataSet makeTestData; - vtkm::cont::DataSet ds = makeTestData.MakePointTransformTestDataSet(); + vtkm::cont::DataSet ds = MakePointTransformTestDataSet(); int N = 41; //Test translation diff --git a/vtkm/filter/testing/UnitTestSplitSharpEdgesFilter.cxx b/vtkm/filter/testing/UnitTestSplitSharpEdgesFilter.cxx index 9a1ec6d90..30b216276 100644 --- a/vtkm/filter/testing/UnitTestSplitSharpEdgesFilter.cxx +++ b/vtkm/filter/testing/UnitTestSplitSharpEdgesFilter.cxx @@ -12,8 +12,8 @@ #include #include +#include #include -#include #include @@ -37,6 +37,79 @@ const std::vector expectedPointvar{ 10.1f, 20.1f, 30.2f, 40. 30.2f, 30.2f, 40.2f, 40.2f, 50.3f, 50.3f, 60.3f, 60.3f, 70.3f, 70.3f, 80.3f, 80.3f }; +vtkm::cont::DataSet Make3DExplicitSimpleCube() +{ + vtkm::cont::DataSet dataSet; + vtkm::cont::DataSetBuilderExplicit dsb; + + const int nVerts = 8; + const int nCells = 6; + using CoordType = vtkm::Vec3f; + std::vector coords = { + CoordType(0, 0, 0), // 0 + CoordType(1, 0, 0), // 1 + CoordType(1, 0, 1), // 2 + CoordType(0, 0, 1), // 3 + CoordType(0, 1, 0), // 4 + CoordType(1, 1, 0), // 5 + CoordType(1, 1, 1), // 6 + CoordType(0, 1, 1) // 7 + }; + + //Connectivity + std::vector shapes; + std::vector numIndices; + for (size_t i = 0; i < 6; i++) + { + shapes.push_back(vtkm::CELL_SHAPE_QUAD); + numIndices.push_back(4); + } + + + std::vector conn; + // Down face + conn.push_back(0); + conn.push_back(1); + conn.push_back(5); + conn.push_back(4); + // Right face + conn.push_back(1); + conn.push_back(2); + conn.push_back(6); + conn.push_back(5); + // Top face + conn.push_back(2); + conn.push_back(3); + conn.push_back(7); + conn.push_back(6); + // Left face + conn.push_back(3); + conn.push_back(0); + conn.push_back(4); + conn.push_back(7); + // Front face + conn.push_back(4); + conn.push_back(5); + conn.push_back(6); + conn.push_back(7); + // Back face + conn.push_back(0); + conn.push_back(3); + conn.push_back(2); + conn.push_back(1); + + //Create the dataset. + dataSet = dsb.Create(coords, shapes, numIndices, conn, "coordinates"); + + vtkm::FloatDefault vars[nVerts] = { 10.1f, 20.1f, 30.2f, 40.2f, 50.3f, 60.3f, 70.3f, 80.3f }; + vtkm::FloatDefault cellvar[nCells] = { 100.1f, 200.2f, 300.3f, 400.4f, 500.5f, 600.6f }; + + dataSet.AddPointField("pointvar", vars, nVerts); + dataSet.AddCellField("cellvar", cellvar, nCells); + + return dataSet; +} + vtkm::cont::DataSet Make3DWavelet() { @@ -129,8 +202,8 @@ void TestSplitSharpEdgesFilterNoSplit(vtkm::cont::DataSet& simpleCubeWithSN, void TestWithExplicitData() { - vtkm::filter::testing::MakeTestDataSet makeTestData; - vtkm::cont::DataSet simpleCube = makeTestData.Make3DExplicitSimpleCube(); + vtkm::cont::DataSet simpleCube = Make3DExplicitSimpleCube(); + // Generate surface normal field vtkm::filter::SurfaceNormals surfaceNormalsFilter; surfaceNormalsFilter.SetGenerateCellNormals(true); diff --git a/vtkm/filter/testing/UnitTestStreamlineFilter.cxx b/vtkm/filter/testing/UnitTestStreamlineFilter.cxx index 5230a49ac..f8b440f10 100644 --- a/vtkm/filter/testing/UnitTestStreamlineFilter.cxx +++ b/vtkm/filter/testing/UnitTestStreamlineFilter.cxx @@ -13,7 +13,6 @@ #include #include #include -#include #include #include diff --git a/vtkm/rendering/testing/Testing.h b/vtkm/rendering/testing/Testing.h index 47818d450..08368cbba 100644 --- a/vtkm/rendering/testing/Testing.h +++ b/vtkm/rendering/testing/Testing.h @@ -13,6 +13,7 @@ #include #include +#include #include #include @@ -51,6 +52,7 @@ inline vtkm::cont::testing::TestEqualResult test_equal_images( const bool& writeDiff = true, const bool& returnOnPass = true) { + vtkm::cont::ScopedRuntimeDeviceTracker runtime(vtkm::cont::DeviceAdapterTagAny{}); vtkm::cont::testing::TestEqualResult testResults; if (fileNames.empty()) @@ -132,6 +134,7 @@ inline vtkm::cont::testing::TestEqualResult test_equal_images( testResults.PushMessage(imageResult.GetMergedMessage()); } + VTKM_LOG_S(vtkm::cont::LogLevel::Info, "Test Results: " << testResults.GetMergedMessage()); return testResults; } @@ -171,7 +174,7 @@ inline vtkm::cont::testing::TestEqualResult test_equal_images_matching_name( const bool& writeDiff = true, const bool& returnOnPass = true) { - std::vector fileNames{ fileName }; + std::vector fileNames; auto found = fileName.rfind("."); auto prefix = fileName.substr(0, found); auto suffix = fileName.substr(found, fileName.length()); @@ -185,12 +188,12 @@ inline vtkm::cont::testing::TestEqualResult test_equal_images_matching_name( if (!check.good()) { VTKM_LOG_S(vtkm::cont::LogLevel::Info, - "Could not find file with name " << fileNameStream.str() << ", beginning testing"); + "Stopped filename search at: " << fileNameStream.str() << ", beginning testing"); break; } fileNames.emplace_back(fileNameStream.str()); } - test_equal_images(view, fileNames, threshold, radius, average, writeDiff, returnOnPass); + return test_equal_images(view, fileNames, threshold, radius, average, writeDiff, returnOnPass); }