You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
605B

  1. add_library(Catch INTERFACE)
  2. target_include_directories(Catch INTERFACE "catch")
  3. add_library(TestMain TestMain.cpp)
  4. target_link_libraries(TestMain Catch)
  5. function(add_test_suite name)
  6. add_executable(${name} ${name}.cpp)
  7. target_link_libraries(${name} TestMain ScopeGuard)
  8. add_test(NAME ${name} COMMAND ${name})
  9. endfunction()
  10. add_test_suite(ScopeGuardTest)
  11. add_test_suite(UniqueResourceTest)
  12. add_custom_target(unittest ScopeGuardTest
  13. COMMAND UniqueResourceTest
  14. COMMENT "Running unittests\n\n"
  15. VERBATIM
  16. )