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

29 行
770B

  1. find_package(Catch2 REQUIRED)
  2. find_package(trompeloeil REQUIRED)
  3. add_library(TestMain TestMain.cpp)
  4. target_link_libraries(TestMain PUBLIC Catch2::Catch2 trompeloeil::trompeloeil)
  5. function(add_test_suite name)
  6. add_executable(${name} ${name}.cpp)
  7. target_link_libraries(${name} PRIVATE TestMain ScopeGuard)
  8. add_test(${name} ${name})
  9. endfunction()
  10. add_test_suite(ScopeExitTest)
  11. add_test_suite(ScopeSuccessTest)
  12. add_test_suite(ScopeFailTest)
  13. add_test_suite(UniqueResourceTest)
  14. add_custom_target(unittest ScopeExitTest
  15. COMMAND ScopeSuccessTest
  16. COMMAND ScopeFailTest
  17. COMMAND UniqueResourceTest
  18. COMMENT "Running unittests\n\n"
  19. VERBATIM
  20. )