rm -rf cmake_build && mkdir cmake_build && cd cmake_build && cmake .. && make
rm -rf cmake_build && mkdir cmake_build && cd cmake_build && cmake -DBUILD_TESTS=ON .. && make
./test/game_unittest
// Just use -DBUILD_TESTS=ON option for cmake.
rm -rf cmake_build && mkdir cmake_build && cd cmake_build && cmake -DBUILD_TESTS=ON -DENABLE_COVERAGE=ON .. && make
// 执行生成的可执行文件
./test/game_unittest
cd cmake_build
lcov --capture --directory . --output-file coverage.info
genhtml coverage.info --output-directory out
rm -rf out/default && gn gen out/default && ninja -C out/default all
上面的命令会在目录 out/default
下,生成两个可执行文件,分别是 game_demo
和 game_unittest
。