Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop tape catch #2995

Merged
merged 3 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Documentation/content/docs/develop_test.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ This guide illustrates how to add tests to the vtk.js repository and how to run

First each VTK class can have several tests spread among several files but we also have infrastructure for global tests which live inside __Sources/Testing/test*.js__.

vtk.js uses [tape](https://github.com/ljharb/tape) for running tests. Please refer to tape's documentation for more information about the test harness API.

## Class tests

In order to add test to vtk.js you will need to create a __test__ directory underneath your class directory.
Expand All @@ -16,7 +18,7 @@ That __test__ directory should contain as many test file as you like with their
Some vtkClass'es don't necessarily involve rendering and can be tested without a WebGL environment. In which case a plain JavaScript test could be written as follows and an additional test() function could be added within the same file:

```js ClassName/test/testExample.js
import test from 'tape-catch';
import test from 'tape';

import vtkMyClass from '..';

Expand All @@ -41,7 +43,7 @@ test('Validate vtkMyClass properties', (t) => {
## Testing rendering with image comparison

```js ClassName/test/testRendering.js
import test from 'tape-catch';
import test from 'tape';

import vtkOpenGLRenderWindow from '../../../../Rendering/OpenGL/RenderWindow';
import vtkRenderWindow from '../../../../Rendering/Core/RenderWindow';
Expand Down
2 changes: 1 addition & 1 deletion Sources/Common/Core/CellArray/test/testCellArray.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';

import vtkCellArray from 'vtk.js/Sources/Common/Core/CellArray';
import { VtkDataTypes } from 'vtk.js/Sources/Common/Core/DataArray/Constants';
Expand Down
2 changes: 1 addition & 1 deletion Sources/Common/Core/DataArray/test/testDataArray.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';
import vtkDataArray from 'vtk.js/Sources/Common/Core/DataArray';
import { VtkDataTypes } from 'vtk.js/Sources/Common/Core/DataArray/Constants';
import * as vtkMath from 'vtk.js/Sources/Common/Core/Math';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';
import testUtils from 'vtk.js/Sources/Testing/testUtils';

import 'vtk.js/Sources/Rendering/Misc/RenderingAPIs';
Expand Down
2 changes: 1 addition & 1 deletion Sources/Common/Core/LookupTable/test/testScalarBar.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';
import testUtils from 'vtk.js/Sources/Testing/testUtils';

import 'vtk.js/Sources/Rendering/Misc/RenderingAPIs';
Expand Down
2 changes: 1 addition & 1 deletion Sources/Common/Core/LookupTable/test/testSetTable.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';
import testUtils from 'vtk.js/Sources/Testing/testUtils';

import 'vtk.js/Sources/Rendering/Misc/RenderingAPIs';
Expand Down
2 changes: 1 addition & 1 deletion Sources/Common/Core/Math/test/testMath.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';
import * as vtkMath from 'vtk.js/Sources/Common/Core/Math';

test('Test angleBetweenVector', (t) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';

import { areEquals } from 'vtk.js/Sources/Common/Core/Math';
import vtkMatrixBuilder from 'vtk.js/Sources/Common/Core/MatrixBuilder';
Expand Down
2 changes: 1 addition & 1 deletion Sources/Common/Core/Points/test/testPoints.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';
import vtkPoints from 'vtk.js/Sources/Common/Core/Points';

test('Test vtkPoints instance', (t) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';
import vtkAbstractPointLocator from 'vtk.js/Sources/Common/DataModel/AbstractPointLocator';

test('Test vtkAbstractPointLocator instance', (t) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';
import vtkMath from 'vtk.js/Sources/Common/Core/Math';
import vtkBoundingBox from 'vtk.js/Sources/Common/DataModel/BoundingBox';

Expand Down
2 changes: 1 addition & 1 deletion Sources/Common/DataModel/Box/test/testBox.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';
import vtkBox from 'vtk.js/Sources/Common/DataModel/Box';

test('Test vtkBox instance', (t) => {
Expand Down
2 changes: 1 addition & 1 deletion Sources/Common/DataModel/Cell/test/testCell.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';
import vtkPoints from 'vtk.js/Sources/Common/Core/Points';
import vtkCell from 'vtk.js/Sources/Common/DataModel/Cell';

Expand Down
2 changes: 1 addition & 1 deletion Sources/Common/DataModel/Collection/test/testCollection.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';
import testUtils from 'vtk.js/Sources/Testing/testUtils';
import vtkCollection from 'vtk.js/Sources/Common/DataModel/Collection';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';
import testUtils from 'vtk.js/Sources/Testing/testUtils';

import 'vtk.js/Sources/Rendering/Misc/RenderingAPIs';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';

import vtkDataSetAttributes from 'vtk.js/Sources/Common/DataModel/DataSetAttributes';
import vtkDataArray from 'vtk.js/Sources/Common/Core/DataArray';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';

import vtkEdgeLocator from 'vtk.js/Sources/Common/DataModel/EdgeLocator';

Expand Down
2 changes: 1 addition & 1 deletion Sources/Common/DataModel/ImageData/test/testImageData.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';
import vtkImageData from 'vtk.js/Sources/Common/DataModel/ImageData';
import vtkRTAnalyticSource from 'vtk.js/Sources/Filters/Sources/RTAnalyticSource';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';
import vtkIncrementalOctreeNode from 'vtk.js/Sources/Common/DataModel/IncrementalOctreeNode';

test('Test vtkIncrementalOctreeNode instance', (t) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';
import vtkIncrementalOctreePointLocator from 'vtk.js/Sources/Common/DataModel/IncrementalOctreePointLocator';

test('Test vtkIncrementalOctreePointLocator instance', (t) => {
Expand Down
2 changes: 1 addition & 1 deletion Sources/Common/DataModel/Line/test/testLine.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';
import vtkLine from 'vtk.js/Sources/Common/DataModel/Line';
import vtkPoints from 'vtk.js/Sources/Common/Core/Points';

Expand Down
2 changes: 1 addition & 1 deletion Sources/Common/DataModel/Locator/test/testLocator.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';
import vtkLocator from 'vtk.js/Sources/Common/DataModel/Locator';

test('Test vtkLocator instance', (t) => {
Expand Down
2 changes: 1 addition & 1 deletion Sources/Common/DataModel/Plane/test/testPlane.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';
import vtkPlane from 'vtk.js/Sources/Common/DataModel/Plane';

test('Test vtkPlane instance', (t) => {
Expand Down
2 changes: 1 addition & 1 deletion Sources/Common/DataModel/PolyData/test/testPolyData.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';
import vtkLine from 'vtk.js/Sources/Common/DataModel/Line';
import vtkTriangle from 'vtk.js/Sources/Common/DataModel/Triangle';
import vtkPolyData from 'vtk.js/Sources/Common/DataModel/PolyData';
Expand Down
2 changes: 1 addition & 1 deletion Sources/Common/DataModel/Quad/test/testQuad.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';
import vtkQuad from 'vtk.js/Sources/Common/DataModel/Quad';
import vtkPoints from 'vtk.js/Sources/Common/Core/Points';
import { QuadWithLineIntersectionState } from 'vtk.js/Sources/Common/DataModel/Quad/Constants';
Expand Down
2 changes: 1 addition & 1 deletion Sources/Common/DataModel/Triangle/test/testTriangle.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';
import * as vtkMath from 'vtk.js/Sources/Common/Core/Math';
import vtkPoints from 'vtk.js/Sources/Common/Core/Points';
import vtkTriangle from 'vtk.js/Sources/Common/DataModel/Triangle';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';
import vtkMath from 'vtk.js/Sources/Common/Core/Math';
import Constants from 'vtk.js/Sources/Common/Transform/LandmarkTransform/Constants';
import LandmarkTransform from 'vtk.js/Sources/Common/Transform/LandmarkTransform';
Expand Down
2 changes: 1 addition & 1 deletion Sources/Filters/Core/Cutter/test/testCutter.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';

import vtkCubeSource from 'vtk.js/Sources/Filters/Sources/CubeSource';
import vtkCutter from 'vtk.js/Sources/Filters/Core/Cutter';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';

import vtkCubeSource from 'vtk.js/Sources/Filters/Sources/CubeSource';
import vtkMath from 'vtk.js/Sources/Common/Core/Math';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';
import testUtils from 'vtk.js/Sources/Testing/testUtils';

import vtkAppendPolyData from 'vtk.js/Sources/Filters/General/AppendPolyData';
Expand Down
2 changes: 1 addition & 1 deletion Sources/Filters/General/Calculator/test/testCalculator.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';

import vtkCalculator from 'vtk.js/Sources/Filters/General/Calculator';
import vtkImageGridSource from 'vtk.js/Sources/Filters/Sources/ImageGridSource';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';
import vtkClipClosedSurface from 'vtk.js/Sources/Filters/General/ClipClosedSurface';
import vtkLineSource from 'vtk.js/Sources/Filters/Sources/LineSource';
import vtkPlane from 'vtk.js/Sources/Common/DataModel/Plane';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';

import vtk from 'vtk.js/Sources/vtk';
import vtkClosedPolyLineToSurfaceFilter from 'vtk.js/Sources/Filters/General/ClosedPolyLineToSurfaceFilter';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';
import vtkContourTriangulator from 'vtk.js/Sources/Filters/General/ContourTriangulator';
import { reverseElements } from '../helper';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';
import testUtils from 'vtk.js/Sources/Testing/testUtils';

import 'vtk.js/Sources/Rendering/Misc/RenderingAPIs';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';

import macro from 'vtk.js/Sources/macros';
import vtkDataArray from 'vtk.js/Sources/Common/Core/DataArray';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';
import testUtils from 'vtk.js/Sources/Testing/testUtils';

import vtkActor from 'vtk.js/Sources/Rendering/Core/Actor';
Expand Down
2 changes: 1 addition & 1 deletion Sources/Filters/General/OBBTree/test/testHelpers.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';

import { CellType } from 'vtk.js/Sources/Common/DataModel/CellTypes/Constants';
import { getCellTriangles } from 'vtk.js/Sources/Filters/General/OBBTree/helper';
Expand Down
2 changes: 1 addition & 1 deletion Sources/Filters/General/OBBTree/test/testOBBTree.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';

import vtkCubeSource from 'vtk.js/Sources/Filters/Sources/CubeSource';
import vtkMath from 'vtk.js/Sources/Common/Core/Math';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';
import testUtils from 'vtk.js/Sources/Testing/testUtils';

import 'vtk.js/Sources/Rendering/Misc/RenderingAPIs';
Expand Down
2 changes: 1 addition & 1 deletion Sources/Filters/General/TubeFilter/test/testTubeColors.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';
import testUtils from 'vtk.js/Sources/Testing/testUtils';
import vtkPoints from 'vtk.js/Sources/Common/Core/Points';
import vtkPolyData from 'vtk.js/Sources/Common/DataModel/PolyData';
Expand Down
2 changes: 1 addition & 1 deletion Sources/Filters/General/TubeFilter/test/testTubeFilter.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';
import testUtils from 'vtk.js/Sources/Testing/testUtils';

import vtk from 'vtk.js/Sources/vtk';
Expand Down
2 changes: 1 addition & 1 deletion Sources/Filters/General/WarpScalar/test/testWarp.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';

import vtkWarpScalar from 'vtk.js/Sources/Filters/General/WarpScalar';
import vtkSphereSource from 'vtk.js/Sources/Filters/Sources/SphereSource';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';
import testUtils from 'vtk.js/Sources/Testing/testUtils';

import 'vtk.js/Sources/Rendering/Misc/RenderingAPIs';
Expand Down
2 changes: 1 addition & 1 deletion Sources/Filters/Sources/ConeSource/test/testCone.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';
import testUtils from 'vtk.js/Sources/Testing/testUtils';

import 'vtk.js/Sources/Rendering/Misc/RenderingAPIs';
Expand Down
2 changes: 1 addition & 1 deletion Sources/Filters/Sources/CubeSource/test/testCube.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';
import testUtils from 'vtk.js/Sources/Testing/testUtils';

import vtkActor from 'vtk.js/Sources/Rendering/Core/Actor';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';
import testUtils from 'vtk.js/Sources/Testing/testUtils';

import 'vtk.js/Sources/Rendering/Misc/RenderingAPIs';
Expand Down
2 changes: 1 addition & 1 deletion Sources/Filters/Sources/LineSource/test/testLine.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';
import testUtils from 'vtk.js/Sources/Testing/testUtils';

import 'vtk.js/Sources/Rendering/Misc/RenderingAPIs';
Expand Down
2 changes: 1 addition & 1 deletion Sources/Filters/Sources/PlaneSource/test/testPlane.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';
import testUtils from 'vtk.js/Sources/Testing/testUtils';

import 'vtk.js/Sources/Rendering/Misc/RenderingAPIs';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';
import testUtils from 'vtk.js/Sources/Testing/testUtils';

import 'vtk.js/Sources/Rendering/Misc/RenderingAPIs';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';
import vtkCubeSource from 'vtk.js/Sources/Filters/Sources/CubeSource';
import vtkTextureMapToPlane from 'vtk.js/Sources/Filters/Texture/TextureMapToPlane';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';
import vtkCubeSource from 'vtk.js/Sources/Filters/Sources/CubeSource';
import vtkTextureMapToSphere from 'vtk.js/Sources/Filters/Texture/TextureMapToSphere';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';
import HttpDataAccessHelper from '../HttpDataAccessHelper';

test('Test array.ref.url is used', (t) => {
Expand Down
2 changes: 1 addition & 1 deletion Sources/IO/Misc/OBJReader/test/testOBJReader.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';
import vtkCellArray from 'vtk.js/Sources/Common/Core/CellArray';
import vtkOBJReader from 'vtk.js/Sources/IO/Misc/OBJReader';
import vtkPolyDataNormals from 'vtk.js/Sources/Filters/Core/PolyDataNormals';
Expand Down
2 changes: 1 addition & 1 deletion Sources/IO/Misc/PDBReader/test/testMolecule.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';
import testUtils from 'vtk.js/Sources/Testing/testUtils';

import vtkActor from 'vtk.js/Sources/Rendering/Core/Actor';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';
import vtkXMLImageDataReader from '../index';
import vtkMath from '../../../../Common/Core/Math';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';
import vtkImageDataWriter from '../index';
import vtkImageData from '../../../../Common/DataModel/ImageData';

Expand Down
2 changes: 1 addition & 1 deletion Sources/Imaging/Core/ImageReslice/test/testImageReslice.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';
import testUtils from 'vtk.js/Sources/Testing/testUtils';

import { mat4 } from 'gl-matrix';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';

import vtkMouseRangeManipulator from 'vtk.js/Sources/Interaction/Manipulators/MouseRangeManipulator';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';
import testUtils from 'vtk.js/Sources/Testing/testUtils';

import vtkActor from 'vtk.js/Sources/Rendering/Core/Actor';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';
import { vec3 } from 'gl-matrix';
import testUtils from 'vtk.js/Sources/Testing/testUtils';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';

import vtkPiecewiseFunctionProxy from 'vtk.js/Sources/Proxy/Core/PiecewiseFunctionProxy';
import Constants from 'vtk.js/Sources/Proxy/Core/PiecewiseFunctionProxy/Constants';
Expand Down
2 changes: 1 addition & 1 deletion Sources/Proxy/Core/View2DProxy/test/testView2DProxy.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape';
import testUtils from 'vtk.js/Sources/Testing/testUtils';

// Load the rendering pieces we want to use (for both WebGL and WebGPU)
Expand Down
Loading
Loading