Use bundled gtest (#4900)

* Suggest to use gtest bundled with dmlc

* Use dmlc bundled gtest in all CI scripts

* Make clang-tidy to use dmlc embedded gtest
This commit is contained in:
Oleksandr Pryimak
2019-10-09 16:26:19 -07:00
committed by Philip Hyunsu Cho
parent 095de3bf5f
commit 80977182c5
9 changed files with 17 additions and 60 deletions

View File

@@ -118,21 +118,19 @@ To run this check locally, run the following command from the top level source t
.. code-block:: bash
cd /path/to/xgboost/
python3 tests/ci_build/tidy.py --gtest-path=/path/to/google-test
where ``--gtest-path`` option specifies the full path of Google Test library.
python3 tests/ci_build/tidy.py
Also, the script accepts two optional integer arguments, namely ``--cpp`` and ``--cuda``. By default they are both set to 1, meaning that both C++ and CUDA code will be checked. If the CUDA toolkit is not installed on your machine, you'll encounter an error. To exclude CUDA source from linting, use:
.. code-block:: bash
cd /path/to/xgboost/
python3 tests/ci_build/tidy.py --cuda=0 --gtest-path=/path/to/google-test
python3 tests/ci_build/tidy.py --cuda=0
Similarly, if you want to exclude C++ source from linting:
.. code-block:: bash
cd /path/to/xgboost/
python3 tests/ci_build/tidy.py --cpp=0 --gtest-path=/path/to/google-test
python3 tests/ci_build/tidy.py --cpp=0

View File

@@ -104,14 +104,13 @@ In addition, to test CUDA code, run:
C++: Google Test
================
To build and run C++ unit tests, install `Google Test <https://github.com/google/googletest>`_ library with headers
and then enable tests while running CMake:
To build and run C++ unit tests enable tests while running CMake:
.. code-block:: bash
mkdir build
cd build
cmake -DGOOGLE_TEST=ON -DGTEST_ROOT=/path/to/google-test ..
cmake -DGOOGLE_TEST=ON -DUSE_DMLC_GTEST=ON ..
make
make test
@@ -121,7 +120,7 @@ To enable tests for CUDA code, add ``-DUSE_CUDA=ON`` and ``-DUSE_NCCL=ON`` (CUDA
mkdir build
cd build
cmake -DGOOGLE_TEST=ON -DGTEST_ROOT=/path/to/google-test -DUSE_CUDA=ON -DUSE_NCCL=ON ..
cmake -DGOOGLE_TEST=ON -DUSE_DMLC_GTEST=ON -DUSE_CUDA=ON -DUSE_NCCL=ON ..
make
make test