mirror of
https://git.mirrors.martin98.com/https://github.com/google/draco
synced 2025-09-15 17:33:14 +08:00
Add googletest as a git submodule. (#756)
- Add the submodule. - Update the build to use googletest sources from the submodule. - Update the github test build checkout action to include submodules. - Update build instructions to include the submodule update.
This commit is contained in:
parent
6a947d2b04
commit
c880d79457
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@ -24,6 +24,8 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: true
|
||||
- run: git clone https://github.com/google/googletest.git ../googletest
|
||||
- run: mkdir _gh_build
|
||||
- run: cmake -G "${{ matrix.generator }}" -DENABLE_TESTS=ON ..
|
||||
|
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
[submodule "third_party/googletest"]
|
||||
path = third_party/googletest
|
||||
url = https://github.com/google/googletest.git
|
21
BUILDING.md
21
BUILDING.md
@ -114,17 +114,26 @@ $ cmake ../ -DDRACO_SANITIZE=address
|
||||
Googletest Integration
|
||||
----------------------
|
||||
|
||||
Draco includes testing support built using Googletest. To enable Googletest unit
|
||||
test support the DRACO_TESTS cmake variable must be turned on at cmake
|
||||
generation time:
|
||||
Draco includes testing support built using Googletest. The Googletest repository
|
||||
is included as a submodule of the Draco git repository. Run the following
|
||||
command to clone the Googletest repository:
|
||||
|
||||
~~~~~ bash
|
||||
$ git submodule update --init
|
||||
~~~~~
|
||||
|
||||
To enable Googletest unit test support the DRACO_TESTS cmake variable must be
|
||||
turned on at cmake generation time:
|
||||
|
||||
~~~~~ bash
|
||||
$ cmake ../ -DDRACO_TESTS=ON
|
||||
~~~~~
|
||||
|
||||
When cmake is used as shown in the above example the googletest directory must
|
||||
be a sibling of the Draco repository root directory. To run the tests execute
|
||||
`draco_tests` from your build output directory.
|
||||
To run the tests execute `draco_tests` from your build output directory:
|
||||
|
||||
~~~~~ bash
|
||||
$ ./draco_tests
|
||||
~~~~~
|
||||
|
||||
WebAssembly Decoder
|
||||
-------------------
|
||||
|
@ -69,14 +69,15 @@ list(
|
||||
"${draco_src_root}/point_cloud/point_cloud_test.cc")
|
||||
|
||||
list(APPEND draco_gtest_all
|
||||
"${draco_root}/../googletest/googletest/src/gtest-all.cc")
|
||||
"${draco_root}/third_party/googletest/googletest/src/gtest-all.cc")
|
||||
list(APPEND draco_gtest_main
|
||||
"${draco_root}/../googletest/googletest/src/gtest_main.cc")
|
||||
"${draco_root}/third_party/googletest/googletest/src/gtest_main.cc")
|
||||
|
||||
macro(draco_setup_test_targets)
|
||||
if(DRACO_TESTS)
|
||||
if(NOT (EXISTS ${draco_gtest_all} AND EXISTS ${draco_gtest_main}))
|
||||
message(FATAL "googletest must be a sibling directory of ${draco_root}.")
|
||||
message(FATAL_ERROR
|
||||
"googletest missing, run git submodule update --init")
|
||||
endif()
|
||||
|
||||
list(APPEND draco_test_defines GTEST_HAS_PTHREAD=0)
|
||||
|
1
third_party/googletest
vendored
Submodule
1
third_party/googletest
vendored
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 703bd9caab50b139428cea1aaff9974ebee5742e
|
Loading…
x
Reference in New Issue
Block a user