[CDRIVER-6107] Add Test Case Tag Support #2135
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Refer: CDRIVER-6107
This changeset introduces the ability to apply label/tags to test cases, and exposes those as CTest labels.
This also includes new general mutable string and array/vector handling utilities, and refactors a lot of our test suite to use those.
Changes:
because
clause on allmlib_check
assertions. This message is included in the output when the program terminates, and acts as inline documentation for why a particular assertion is present.mstr
, the data-owning counterpart tomstr_view
. This piece has been in a stash for a while, and was brought out as a better way to handle mutable strings.vec.t.h
, a generic template header that is used to define vector types. Basically:#define
a typeT
, and then#include <mlib/vec.t.h>
, and it will define aT_vec
type that acts as a dynamically sized contiguous array ofT
objects.mstr_trim
for removing whitespace from string views.mtsr
andvec.t.h
types. Also addsmlib/str_vec.h
which just defines themstr_vec
for the very common "array of strings" type.[bracketed][tags]
.LoadTests.cmake
, the--tests-cmake
switch will print CMake code that defines all the test cases. I wanted to use JSON to emit the test cases, but CMake's JSON handling functionality is incredibly slow for very large JSON blobs, so directly emitting CMake code was chosen instead.LoadTests.cmake
will evaluate the emitted CMake code and use it to calladd_test
for all the test cases, as well as apply the test case labels and fixtures.[uses:foo]
, thenLoadTests.cmake
will add aFIXTURES_REQUIRED
ofmongoc/fixtures/foo
. This currently only applies to the IMDS tests, but will eventually be used for other test case fixtures.