clar: fix parsing of test suite prefixes#3881
Merged
carlosmn merged 1 commit intoAug 5, 2016
Merged
Conversation
When passing in a specific suite which should be executed by clar via `-stest::suite`, we try to parse this string and then include all tests contained in this suite. This also includes all tests in sub-suites, e.g. 'test::suite::foo'. In the case where multiple suites start with the same _string_, for example 'test::foo' and 'test::foobar', we fail to distinguish this correctly. When passing in `-stest::foobar`, we wrongly determine that 'test::foo' is a prefix and try to execute all of its matching functions. But as no function will now match 'test::foobar', we simply execute nothing. To fix this, we instead have to check if the prefix is an actual suite prefix as opposed to a simple string prefix. We do so by by inspecting if the first two characters trailing the prefix are our suite delimiters '::', and only consider the filter as matching in this case.
Member
Author
|
Btw, forgot to mention in the commit message: this actually hits us when trying to execute |
Member
|
Interesting! Would you mind opening this also against https://github.com/vmg/clar so that we can make sure that it lands upstream? |
Member
Author
|
Sure. Didn't know upstream actually existed. |
Member
Author
Member
Author
|
This has been merged upstream by @vmg |
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
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.
When passing in a specific suite which should be executed by clar
via
-stest::suite, we try to parse this string and then includeall tests contained in this suite. This also includes all tests
in sub-suites, e.g. 'test::suite::foo'.
In the case where multiple suites start with the same string,
for example 'test::foo' and 'test::foobar', we fail to
distinguish this correctly. When passing in
-stest::foobar,we wrongly determine that 'test::foo' is a prefix and try to
execute all of its matching functions. But as no function
will now match 'test::foobar', we simply execute nothing.
To fix this, we instead have to check if the prefix is an actual
suite prefix as opposed to a simple string prefix. We do so by by
inspecting if the first two characters trailing the prefix are
our suite delimiters '::', and only consider the filter as
matching in this case.