Fixes #18816
This PR enables functional tests to be included in the ctest suite when the ENABLE_FUNCTIONAL_TESTS flag is set to ON during the CMake configuration.
i.e
0cmake -B build -DENABLE_FUNCTIONAL_TESTS=ON
1cmake --build build
2ctest --test-dir build