[CXX-2302] Finer-Grained Test Definition for Catch2 and for CTest Created: 14/Jul/21  Updated: 08/Feb/23

Status: Backlog
Project: C++ Driver
Component/s: Testing
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Unknown
Reporter: Colby Pike Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Epic Link: CXX Driver Testing (Evergreen)

 Description   

Catch2 supports dynamically defining test cases, and also supports dynamically loading them into CTest. Instead of a monolithinc "test_unified_format_spec" test case from a single test executable, we can use `registerTestCase()` in Catch2 to dynamically add test cases for each test defined in the test spec files.

Additionally, the catch_discover_tests() CMake command (from Catch.cmake) can be used to register each Catch2 test case as a test in CTest. From this, CTest can track and execute each Catch2 test case individually, including in parallel, respecting `--rerun-failed`, detecting skips, etc.



 Comments   
Comment by Githook User [ 21/Sep/21 ]

Author:

{'name': 'vector-of-bool', 'email': 'vectorofbool@gmail.com', 'username': 'vector-of-bool'}

Message: Allow CTest as a test driver (#870)

  • Allow fine-grained test control via CTest

Previously, a single test was defined for test-libmongoc.
This change allows CTest to see the individual test cases
contained within test-libmongoc. These can be selected
and executed with the CTest CLI, including with
some parallelism.

Tag CXX-2301 CXX-2302

  • Fix duplicate test registration
  • Use a signal handler to see abnormal termination.
Generated at Wed Feb 07 22:05:29 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.