-
Notifications
You must be signed in to change notification settings - Fork 456
[CDRIVER-6107] Add Test Case Tag Support #2135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
vector-of-bool
wants to merge
19
commits into
mongodb:master
Choose a base branch
from
vector-of-bool:CDRIVER-6107-test-tags
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
[CDRIVER-6107] Add Test Case Tag Support #2135
vector-of-bool
wants to merge
19
commits into
mongodb:master
from
vector-of-bool:CDRIVER-6107-test-tags
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This change allows for test cases to declare any number of associated "tags". The tags are specified after the test case name string as a list of bracketed tags, mimicking Catch2's syntax. The LoadTests.cmake script has been modified to apply test case's declared tags as CTest labels. This also gives us the ability to apply test fixture requirements granularly on only tests that declare their requirement (via a tag).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.