541 {
543 for (const auto& testcase : suites_) {
544 if (testcase.second.instantiated) continue;
545 if (ignored.find(testcase.first) != ignored.end()) continue;
546
548 "Type parameterized test suite " + testcase.first +
549 " is defined via REGISTER_TYPED_TEST_SUITE_P, but never instantiated "
550 "via INSTANTIATE_TYPED_TEST_SUITE_P. None of the test cases will run."
551 "\n\n"
552 "Ideally, TYPED_TEST_P definitions should only ever be included as "
553 "part of binaries that intend to use them. (As opposed to, for "
554 "example, being placed in a library that may be linked in to get other "
555 "utilities.)"
556 "\n\n"
557 "To suppress this error for this test suite, insert the following line "
558 "(in a non-header) in the namespace it is defined in:"
559 "\n\n"
560 "GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(" +
561 testcase.first + ");";
562
563 std::string full_name =
564 "UninstantiatedTypeParameterizedTestSuite<" + testcase.first + ">";
566 "GoogleTestVerification", full_name.c_str(),
567 nullptr,
568 nullptr,
569 testcase.second.code_location.file.c_str(),
570 testcase.second.code_location.line, [
message, testcase] {
571 return new FailureTest(testcase.second.code_location, message,
572 kErrorOnUninstantiatedTypeParameterizedTest);
573 });
574 }
575}
TestInfo * RegisterTest(const char *test_suite_name, const char *test_name, const char *type_param, const char *value_param, const char *file, int line, Factory factory)
std::set< std::string > * GetIgnoredParameterizedTestSuites()