A different directory for GTest cxx files?


@dzenanz suggested me to discuss this issue here at the forum, as it is more like a question:

ITK\Modules\Core\Common\test now has more than 200 source files. While I think it’s great to have such a large number of tests, I feel it becomes a bit cumbersome to find a specific test file in this directory. It seems to me that it it would be more convenient to place the GTest cxx files of the Core module into their own “gtest” subdirectory:


Currently, the ITK Core has 11 GTest cxx files. I expect (and hope) that this number will still grow very much, in years to come.

Do you guys agree that it would be useful to move the GTest cxx to such a “gtest” subdirectory?

Of course, this issue could be applicable to other ITK modules as well. But the Core module appears to have the most GTest cxx files, and it also appears to have the most tests in one (almost) flat subdirectory.

Common is the largest module by far. And it is probably has better test coverage than any other module too. I don’t think any other module is even close to it. A split into Test+GTest subdirectories would complicate the build system further, and should probably be extended into remote modules. The benefit is small.

What you might need is a good file searching tool. I use Everything on Windows and Catfish on Ubuntu.

As @dzenanz noted, there would be complications to the build system by adding a new top level directory to the module. Also, a more appropriate place to make the split in the hierachy would be inside test/ versus the top the module. So Common/test/GTest/*.cxx, for example.