Skip to content

Remove all *New tests

Julien Michel requested to merge 1649-remove-New-tests into develop

Summary

This MR is part of #1649 (closed) story. It removes all New tests code, and CMake test declarations.

Rationale

New test are a legacy from the beginning of OTB. They only contain a template class declaration and instanciation by calling the New() method. The rationale behind New tests is that if you have template code and you do not at least do that, the code is actually never compiled (and thus checked for compilation errors). While this sounds reasonable, in fact most of classes also have a more complete testing, which starts with template declaration and instanciation, doing the job of the New test already.

New tests thus mostly provides additional *.o to build and additional tests to run, with a marignal impact on code coverage.

This MR remove 344 *.o and associated tests, and should speed up the build/test process.

Implementation Details

Remove cxx files: find . -name *New.cxx | xargs git rm

Remove associated REGISTER_TESTS() in test drivers: find . -name *TestDriver.cxx | xargs sed -i '/.*New/d'

Remove build of cx files: find . -name CMakeLists.txt | xargs sed -i '/New.cxx$/d'

Remove tests declaration (a few manual fixes required): find . -name CMakeLists.txt | xargs sed -i '/add_test(NAME .*New/,+2d'

After that, there are still 25 new tests that are declared in other cxx tests files, which should be removed manually.

Copyright

The copyright owner is CNES and has signed the ORFEO ToolBox Contributor License Agreement.


***Check before merging:*** - All discussions are resolved - At least 2 👍 votes from core developers, no 👎 vote. - The feature branch is (reasonably) up-to-date with the base branch - Dashboard is green - Copyright owner has signed the ORFEO ToolBox Contributor License Agreement

Merge request reports

Loading