The question is about google-test framework. I want to run all tests excluding some according to multiple exclusion filters, like: --gtest_filter=-ABC.*:-BCD.*

2 Answers

You group the patterns in the form --gtest_filter=POSTIVE_PATTERNS[-NEGATIVE_PATTERNS]

So in this case, you want --gtest_filter=-ABC.*:BCD.*

2

See . You can find a clear example there.

Exclusions are identified by '-' sign. You can say multiple seperated by :. no need of repeating - with :.

--gtest_filter=-*str* :This will run tests that don't contain string "str".

--gtest_filter=-*str1*:*str2* :This will run tests that don't contain either "str1" or "str2":

--gtest_filter=*str*:-*str1*:*str2* :This will run tests that contain str and that do not contain either str1 or str2.

So, anything followed by '-' will be counted for exclusion list.

So, in your case it will be --gtest_filter=-ABC.*:BCD.*

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy