0

I have a big set of tests. I want to run a subset of these tests. But this subset includes many tests. So, I use a negative pattern. For example:

--gtest_filter=TestSet.*-TestSet.Case1:TestSet.Case2:TestSet.Case3:....:TestSet.CaseN

The result is that length of filter is too long.

Is there anything I can do to solve this problem?

Mike Kinghan
  • 55,740
  • 12
  • 153
  • 182
wang
  • 1
  • 1

1 Answers1

0

The filter length limit is probably imposed by the operating system on the shell. See this SO post on the subject.

As a workaround, with the positive side effect of improving the structure of your unit tests, you can rename your tests in a way that you can use a simpler filter pattern, e.g. --gtest_filter="TestSet.Subset*"

Community
  • 1
  • 1
Antonio Pérez
  • 6,702
  • 4
  • 36
  • 61
  • I try to find out the length problem. I think there is no length limit in GTest. But i'll do some changes base on your advice. Thanks a lot. – wang May 30 '16 at 01:47
  • After thinking twice on the length problem, I think it's probably a shell command limit, not Google Test's thing. Updating answer. – Antonio Pérez May 30 '16 at 07:21