# Tests not found

**URL:** https://discourse.vtk.org/t/tests-not-found/8351
**Category:** Support
**Created:** [April 22, 2022, 2:26pm UTC](https://discourse.vtk.org/t/tests-not-found/8351 "2022-04-22T14:26:53Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![ghlecl](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/g/d78d45/32.png) [@ghlecl](https://discourse.vtk.org/u/ghlecl)
#### Post date: [April 22, 2022, 2:26pm UTC](https://discourse.vtk.org/t/tests-not-found/8351/1 "2022-04-22T14:26:53Z")

</div>

Hello.

I am trying to build VTK, and then run the tests on my machine.

- I am using CMake 3.22.4.
- I have downloaded the release source tarball for VTK on the website (version 9.1.0).
- I am on macOS (Big Sur 11.6.5).
- I have Macports python 3.10 in the path (`which python` finds it).
- I have used ccmake and changed the following variables:  
\* BUILD\_SHARED\_LIBS = OFF  
\* CMAKE\_BUILD\_TYPE = Release  
\* CMAKE\_INSTALL\_PREFIX = /sw/local/  
\* VTK\_BUILD\_TESTING = WANT

When I start the build, it runs through 4238 targets and completes. But when I then run `ctest`, it says it does not find any test, and if I try `ninja test`, it says it is not a target.

Am I doing something wrong. From the build documentation, I could not find anything. I tried rebuilding setting (on top of VTK\_BUILD\_TESTING) the variable TESTING=ON and BUILD\_TESTING=ON. It changed absolutely nothing.

Any help would be appreciated.  
Thanks.

(Edit: added the BUILD\_SHARED\_LIBS=OFF variable to the modified CMake variables.)

---

<div class="post-metadata">

### Author: ![ghlecl](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/g/d78d45/32.png) [@ghlecl](https://discourse.vtk.org/u/ghlecl)
#### Post date: [April 22, 2022, 3:55pm UTC](https://discourse.vtk.org/t/tests-not-found/8351/2 "2022-04-22T15:55:44Z")

</div>

I have further tried some of the instructions in the build.md file.  
Specifically, I have tried downloading the data via the VTKData target.  
I have tried using ninja and make.  
In either case, the VTKData target does not exist.  
I am attaching a screenshot of the results.

 ![Screen Shot 2022-04-22 at 11.43.49](https://discourse.vtk.org/uploads/default/original/2X/7/7018c9cb114deee526980d00046aed83d77816fb.png)

---

<div class="post-metadata">

### Author: ![dgobbi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dgobbi/32/18_2.png) [@dgobbi](https://discourse.vtk.org/u/dgobbi)
#### Post date: [April 22, 2022, 5:31pm UTC](https://discourse.vtk.org/t/tests-not-found/8351/3 "2022-04-22T17:31:30Z")

</div>

If `VTK_BUILD_TESTING` is `ON`, then the test data will automatically be downloaded when you build VTK.

So all that should be needed is to run “ninja” to build, and run “ctest” to test. Both of these must be run from the build directory.

---

<div class="post-metadata">

### Author: ![ghlecl](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/g/d78d45/32.png) [@ghlecl](https://discourse.vtk.org/u/ghlecl)
#### Post date: [April 22, 2022, 5:36pm UTC](https://discourse.vtk.org/t/tests-not-found/8351/4 "2022-04-22T17:36:34Z")

</div>

I tried setting it to ON or WANT and neither worked. I always issued all my commands from the build directory.

Looking deeper into this, I found this code in vtkTesting.cmake

```nohighlight
if (NOT EXISTS "${VTK_SOURCE_DIR}/.ExternalData/README.rst")
  # This file is always present in version-controlled source trees
  # so we must have been extracted from a source tarball with no
  # data objects needed for testing. Turn off tests by default
  # since enabling them requires network access or manual data
  # store configuration.
  set(VTK_BUILD_TESTING OFF)
endif ()

```

Right after those lines, I inserted an extra `message` command and realized that no matter what I asked for, testing was always set back to OFF.

Does this mean that testing is not supported anymore when building from the tarball and that I should clone the VTK git?

For most libraries, I like to download the tarball and build from it with tests to insure the build is not bad, but if it is not supported anymore, I’ll look into using git.

I have currently _cheated_ and modified the vtkTesting.cmake file manually to set `VTK_BUILD_TESTING` back to `ON` right after it was set to OFF. I now have over 8000 targets (most of them download targets) and the build is ongoing.

Thanks for your time.

---

<div class="post-metadata">

### Author: ![dgobbi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dgobbi/32/18_2.png) [@dgobbi](https://discourse.vtk.org/u/dgobbi)
#### Post date: [April 22, 2022, 6:07pm UTC](https://discourse.vtk.org/t/tests-not-found/8351/5 "2022-04-22T18:07:33Z")

</div>

I’d never seen that before, though it dates back to VTK 6.1.

It would have been easy for the developer who wrote that code to provide a message:

```nohighlight
    if (VTK_BUILD_TESTING)
        message(STATUS "VTK_BUILD_TESTING was ${VTK_BUILD_TESTING}, but testing"
                " is disabled because there is no .ExternalData/README.rst in the"
                " source tree.")
    endif ()

etcetera

```

---

<div class="post-metadata">

### Author: ![ghlecl](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/g/d78d45/32.png) [@ghlecl](https://discourse.vtk.org/u/ghlecl)
#### Post date: [April 22, 2022, 6:36pm UTC](https://discourse.vtk.org/t/tests-not-found/8351/6 "2022-04-22T18:36:11Z")

</div>

I would tend to agree, but I would also prefer that when I as a user specify that I want the tests, that even if they required bandwith or someting, that request is “honored”.

Warn me that it will download a large amount of data at the configure stage so that I can change my mind or something, but simply not compiling the tests without any other signal was a bit confusing. It is weird to have the option if it ends up being ignored. Maybe a better alternative is to not present the option (i.e. not have VTK\_BUILD\_TESTING in ccmake or cmake-gui) when the file is not found?

Anyhow, I have redownloaded the source tarball, I went into the source directory and created an empty `.ExternalData/README.rst` file. Then, in another location, I created a build directory, configure with ccmake specifying that I want the tests and everything went as I expected.

Thanks again.

---

<div class="post-metadata">

### Author: ![dgobbi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dgobbi/32/18_2.png) [@dgobbi](https://discourse.vtk.org/u/dgobbi)
#### Post date: [April 23, 2022, 3:23pm UTC](https://discourse.vtk.org/t/tests-not-found/8351/7 "2022-04-23T15:23:20Z")

</div>

I hear your frustration. I did a little bit more digging. Unfortunately there seems to be no documentation about how to build and test with the download tarballs.

The `VTKData-9.1.0.tar.gz` tarball contains `VTK-9.1.0/.ExternalData/README.rst` and all the data files (as an object store in `VTK-9.1.0/.ExternalData/SHA512`).

It seems that, for testing, people are expected (but not told) to untar `VTKData-9.1.0.tar.gz` over top of their `VTK-9.1.0` source directory. This will provide the thousands of data files that would otherwise be downloaded during the build.

How anyone is expected to figure this out on their own, I don’t know. Especially since `.ExternalData` is a hidden directory. The `VTKData` build target doesn’t appear unless this is done before `VTK_BUILD_TESTING` is turned on.
