kevingurney opened a new pull request #10614:
URL: https://github.com/apache/arrow/pull/10614


   **Overview**
   
   This Pull Request integrates GoogleTest with the CMake build system for the 
MATLAB interface.
   
   1. A user can supply a custom 
[`GTEST_ROOT`](https://cmake.org/cmake/help/latest/module/FindGTest.html) value 
to CMake in order to make use of pre-built GoogleTest binaries.
   
   2. A user can provide no `GTEST_ROOT` value, and CMake will automatically 
fetch and build GoogleTest from source using the 
[`build_dependency`](https://github.com/apache/arrow/blob/57ecc73e6153fea04e0ac0d13792ba0abb0dd779/cpp/cmake_modules/ThirdpartyToolchain.cmake#L137)
 macro declared in 
[`cpp/cmake_modules/ThirdpartyToolchain.cmake`](https://github.com/apache/arrow/blob/master/cpp/cmake_modules/ThirdpartyToolchain.cmake).
   
   **Implementation**
   
   This implementation leverages the existing 
[`build_dependency`](https://github.com/apache/arrow/blob/57ecc73e6153fea04e0ac0d13792ba0abb0dd779/cpp/cmake_modules/ThirdpartyToolchain.cmake#L137)
 macro declared in 
[`cpp/cmake_modules/ThirdpartyToolchain.cmake`](https://github.com/apache/arrow/blob/master/cpp/cmake_modules/ThirdpartyToolchain.cmake)
 to automatically fetch and build GoogleTest from source.
   
   **Testing**
   
   1. These changes were qualified against the following platform/compiler 
configurations:
    1.1. Windows 10 with Visual Studio 2019
    1.2. macOS Big Sur (11.2.3) with GNU Make 3.81
    1.3. Debian 10 with GNU Make GNU 4.2.1
   
   2. We ran the CMake build with a custom `GTEST_ROOT` value that points to 
GoogleTest binaries that were built via the CMake `googletest_ep` target from 
the Arrow C++ libraries. In other words, we built GoogleTest with `cmake 
-DARROW_BUILD_TESTS=ON  ..; make googletest_ep`.
   3. We ran the CMake build without specifying a `GTEST_ROOT` value and 
GoogleTest was automatically fetched and built.
   4. We ran the compiled `matlab/src/placeholder_test.cc` GoogleTest test 
suite on all platforms using `ctest`.
   5. We ran the compiled `matlab/src/placeholder_test.cc` GoogleTest test 
suite on:
    5.1. Debian using `make test`
    5.2. macOS using `make test`
    5.3. Windows using `devenv.com mlarrow.sln /build Release /project 
RUN_TESTS`
   
   **Future Directions**
   
   1. As follow up work to this PR, a major priority is to integrate the MATLAB 
interface with Arrow CI ecosystem, so that both C++ and MATLAB tests will be 
automatically run with every pull request.
   2. Pending acceptance of this pull request, the MATLAB interface will have 
C++ testing infrastructure in place. This will allow us to shift focus towards 
incremental delivery of C++ feature code, along with associated tests.
   
   **Note**
   
   1. Thank you to @lafiona for helping me with this pull request!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to