您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

CMakeLists.txt 852B

12345678910111213141516171819202122232425262728293031323334
  1. add_library(Catch INTERFACE)
  2. target_include_directories(Catch INTERFACE "catch")
  3. add_library(Trompeloeil INTERFACE)
  4. target_include_directories(Trompeloeil INTERFACE "trompeloeil")
  5. add_library(TestMain TestMain.cpp)
  6. target_link_libraries(TestMain Catch Trompeloeil)
  7. function(add_test_suite name)
  8. add_executable(${name} ${name}.cpp)
  9. target_link_libraries(${name} TestMain ScopeGuard)
  10. add_test(${name} ${name})
  11. endfunction()
  12. add_test_suite(ScopeExitTest)
  13. add_test_suite(ScopeSuccessTest)
  14. add_test_suite(ScopeFailTest)
  15. add_test_suite(UniqueResourceTest)
  16. add_custom_target(unittest ScopeExitTest
  17. COMMAND ScopeSuccessTest
  18. COMMAND ScopeFailTest
  19. COMMAND UniqueResourceTest
  20. COMMENT "Running unittests\n\n"
  21. VERBATIM
  22. )