missing VTKData

Is there an environment variable which needs to be set, so that when the tests are run they find data in
./ExternalData/Testing/Data?
Or is it set in CMake?

Thanks.

Use the Utilities/SetupForDeveloppement.sh scripts, it will set it up for you.

But it should work out of the box when activating testing.

Well I ran the scripts and set up a path for VTK data store, but there are no files in it. What next?

The only noticeable thing it did was to clone some files into
VTK-8/ThirdParty/vtkm/vtkvtkm/vtk-m

Did you enabled BUILD_TESTING ? Did you configured and built VTK ?

Yes to all. I am using Windows 10.

I should say that the data does appear to be in
.\ExternalData\Testing\Data
but the tests look in
../../../../VTKData/Data

So I’m wondering where this folder information is coming from.

It seems the problem arises here

inline
char* vtkTestUtilities::GetDataRoot(int argc, char* argv[])
{
  return vtkTestUtilities::GetArgOrEnvOrDefault(
    "-D", argc, argv,
    "VTK_DATA_ROOT",
    "../../../../VTKData");
}

inline
char* vtkTestUtilities::ExpandDataFileName(int argc, char* argv[],
                                           const char* fname,
                                           int slash)
{
  return vtkTestUtilities::ExpandFileNameWithArgOrEnvOrDefault(
    "-D", argc, argv,
    "VTK_DATA_ROOT",
    "../../../../VTKData",
    fname,
    slash);
}

I either have to pass the data folder as a command line option with -D or setup an environment variable for VTK_DATA_ROOT. So the most generic solution seems to be setting
VTK_DATA_ROOT = "../../../../ExternalData/Testing"

I don’t see how any of this relates to the cmake VTK_DATA_STORE variable.

This is further complicated by the issue that, when running the tests inside Visual Studio, the current working directory is not the root build folder,
C:\build_VTK
or the bin folder
C:\build_VTK\bin\debug
but rather the test project folder
C:\build_VTK\Common\Core\Testing\Cxx

So it would appear that setting the data and testing directories explicitly using -D and -T options for each test project in Visual Studio via Cmake would be the best option i.e.

-D …/…/…/…/ExternalData/Testing
-T …/…/…/…/Testing/Temporary

@ben.boeckel may know more.

This works just fine for any Windows builds I’ve done recently and for our buildbots. Could you show how you configured VTK? Is this from a Git repository or a release tarball?

I build from my own fork of VTK on gitlab. The master branch on the fork is synchronised with (identical to) Kitware’s master branch. I use cmake-gui for the configuration and it is completely standard.

Data management for testing should Just Work in that case. How are you declaring your tests?

I just build the RUN_TESTS project in Visual Studio

Did you at least build the VTKData target first or just the relevant test binary?

Yes. I built the VTKData binary and I have rebuilt it since I updated VTKDataStore. Since I set up the environment variables for VTK_DATA_ROOT and VTK_TEMP_DIR the tests are all working, but I thought they should just work out of the box. Previously some tests certainly did not.

AFAIK, it does work out-of-the-box. Granted, Visual Studio is not likely widely tested, but I can’t think of a reason off-hand why it’d be different in VS. I’ll try and test this week.

@ben.boeckel
I’ve tried running existing tests on the command line using the *CxxTests executable, but anything that is passed data from CMakeLists receives no args in main() and the tests fail. Am I missing a configuration step?

If I cannot get existing tests to run I cannot add a test to https://gitlab.kitware.com/vtk/vtk/merge_requests/6122