1 // Copyright (C) 2018. Huawei Technologies Co., Ltd. All rights reserved. 2 3 #ifndef GTEST_INCLUDE_GTEST_GTEST_FILTER_H_ 4 #define GTEST_INCLUDE_GTEST_GTEST_FILTER_H_ 5 6 #include <string> 7 #include <map> 8 #include <vector> 9 10 namespace testing { 11 namespace ext { 12 13 using ::std::string; 14 using ::std::map; 15 using ::std::vector; 16 17 class TestFilter { 18 public: 19 map<const char*, string*>& getAllFilterFlagsKv(); 20 void printHelp() const; 21 bool postParsingArguments(); 22 bool accept(int flags) const; 23 void reset(); 24 static TestFilter* instance(); 25 26 private: TestFilter()27 TestFilter() {}; 28 static const char* const kStrictFilter; 29 int requiredFlags; 30 // strcit filter requires the entirely same test flags and require no 31 bool strictMode; 32 bool flag_kvs_inited; // teels iff the filter kvs has been parsed 33 bool ready; // teels iff the filter are ready to be used 34 void postSetType(vector<string> vectemp); 35 void postSetSize(vector<string> vectemp); 36 void postSetRank(vector<string> vectemp); 37 map<const char*, string*> filterFlagsKv; 38 vector<int> vecTestLevel; 39 vector<int> vecType; 40 vector<int> vecSize; 41 vector<int> vecRank; 42 }; 43 44 } // namespace ext 45 } // namespace testing 46 47 #endif // GTEST_INCLUDE_GTEST_GTEST_FILTER_H_ 48 49