Skip to content
/ catch Public

CMake Installable version of Catch C++ testing library

License

Notifications You must be signed in to change notification settings

charlesw/catch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Catch

CMake Installable version of Catch unit testing library released under the Boost Software License - Version 1.0.

Usage

  • Add project using ExternalProject_Add, note that due to build order issues the catch package won't be available to find_package in the same project. For this reason a SuperBuild based setup is recommended to handle dependencies.
  • Add catch to your target:
    add_executable(my_test ${MY_TEST_SOURCES})
    
    find_package(catch NO_MODULE REQUIRED)
    target_link_libraries(my_test catch)
  • Configure unit tests via CTest:
    enable_testing()
    add_test(NAME RunTests COMMAND my_test)
    
    add_test(NAME ListTests COMMAND my_test --list-tests)
    set_tests_properties(ListTests PROPERTIES PASS_REGULAR_EXPRESSION "[0-9]+ test cases")
    
    add_test(NAME ListTags COMMAND my_test --list-tags)
    set_tests_properties(ListTags PROPERTIES PASS_REGULAR_EXPRESSION "[0-9]+ tags")

References

About

CMake Installable version of Catch C++ testing library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published