554 bool generated_instantiations =
false;
556 for (
typename TestInfoContainer::iterator test_it = tests_.begin();
557 test_it != tests_.end(); ++test_it) {
558 std::shared_ptr<TestInfo> test_info = *test_it;
559 for (
typename InstantiationContainer::iterator gen_it =
560 instantiations_.begin();
561 gen_it != instantiations_.end(); ++gen_it) {
562 const std::string& instantiation_name = gen_it->name;
563 ParamGenerator<ParamType> generator((*gen_it->generator)());
565 const char* file = gen_it->file;
566 int line = gen_it->line;
568 std::string test_suite_name;
569 if (!instantiation_name.empty())
570 test_suite_name = instantiation_name +
"/";
571 test_suite_name += test_info->test_suite_base_name;
574 std::set<std::string> test_param_names;
577 param_it != generator.end(); ++param_it, ++
i) {
578 generated_instantiations =
true;
580 Message test_name_stream;
582 std::string param_name =
583 name_func(TestParamInfo<ParamType>(*param_it, i));
586 <<
"Parameterized test name '" << param_name
587 <<
"' is invalid, in " << file <<
" line " << line << std::endl;
590 <<
"Duplicate parameterized test name '" << param_name <<
"', in " 591 << file <<
" line " << line << std::endl;
593 test_param_names.insert(param_name);
595 if (!test_info->test_base_name.empty()) {
596 test_name_stream << test_info->test_base_name <<
"/";
598 test_name_stream << param_name;
600 test_suite_name.c_str(), test_name_stream.GetString().c_str(),
606 test_info->test_meta_factory->CreateTestFactory(*param_it));
611 if (!generated_instantiations) {
GTEST_API_ void InsertSyntheticTestCase(const std::string &name, CodeLocation location, bool has_test_p)
static SetUpTearDownSuiteFuncType GetTearDownCaseOrSuite(const char *filename, int line_num)
TypeId GetTestSuiteTypeId() const override
::std::string PrintToString(const T &value)
#define GTEST_CHECK_(condition)
GTEST_API_ TestInfo * MakeAndRegisterTestInfo(const char *test_suite_name, const char *name, const char *type_param, const char *value_param, CodeLocation code_location, TypeId fixture_class_id, SetUpTestSuiteFunc set_up_tc, TearDownTestSuiteFunc tear_down_tc, TestFactoryBase *factory)
std::string(const TestParamInfo< ParamType > &) ParamNameGeneratorFunc
ParamIterator< T > iterator
static SetUpTearDownSuiteFuncType GetSetUpCaseOrSuite(const char *filename, int line_num)
const std::string & GetTestSuiteName() const override