https://github.com/shensunbo/google_test_insight
配置问题
使用 ctest -V
,输出到命令行的测试结果没有颜色
- 可以使用
GTEST_COLOR=1 ctest -V
,但这会污染测试报告1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#!/bin/bash previous_dir=$(pwd) script_path=$(dirname $(realpath $0)) cd $script_path/output/<test script path> if [ "$1" = "--color" ]; then GTEST_COLOR=1 ctest "$@" --output-on-failure else ctest "$@" --output-on-failure fi cd $previous_dir
- 可以直接执行单元测试
bin
文件,默认有颜色