Google-test

测试系列文章:
https://www.jianshu.com/nb/30319209

gtest+clion

gtest是Google的C++单元测试框架,在clion中使用的方式可以看JetBrains官方文档https://www.jetbrains.com/help/clion/creating-google-test-run-debug-configuration-for-test.html,如下所示:

  • 下载Google Test
  • 配置CMakeLists.txt
    CMakeLists

自动化下载gtest文件的google test + clion配置

  • 安装CLion(略)
  • 目录结构:
    1
    2
    3
    4
    5
    6
    7
    8
    + project_home
    + ext // external library
    + gtest // google test framework
    - CMakeLists.txt
    + include // project headers
    + src // project source files
    + test // test files
    - CMakeLists.txt
  • 配置ext/gtest/CMakeLists.txt&CMakeLists.txt(在http://twistoy.com/post/gtest-in-clion/内)

参考资料:
http://twistoy.com/post/gtest-in-clion/