Add ABI-compatible overload for MakeAndRegisterTestInfo to fix v1.14.0 linker errors (#1)

* Add backward-compatible overload for MakeAndRegisterTestInfo
Co-authored-by: kairosci <226562783+kairosci@users.noreply.github.com>

* Complete fix with verification and testing
Co-authored-by: kairosci <226562783+kairosci@users.noreply.github.com>

* Remove CodeQL build artifacts and update gitignore
Co-authored-by: kairosci <226562783+kairosci@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: kairosci <226562783+kairosci@users.noreply.github.com>
This commit is contained in:
Copilot 2025-11-16 19:06:07 +01:00 committed by GitHub
parent ffb6156362
commit 409017ae98
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 23 additions and 0 deletions

1
.gitignore vendored
View File

@ -87,3 +87,4 @@ googlemock/gtest
/CMakeCache.txt /CMakeCache.txt
/ALL_BUILD.vcxproj.filters /ALL_BUILD.vcxproj.filters
/ALL_BUILD.vcxproj /ALL_BUILD.vcxproj
_codeql_*

View File

@ -561,6 +561,15 @@ GTEST_API_ TestInfo* MakeAndRegisterTestInfo(
TypeId fixture_class_id, SetUpTestSuiteFunc set_up_tc, TypeId fixture_class_id, SetUpTestSuiteFunc set_up_tc,
TearDownTestSuiteFunc tear_down_tc, TestFactoryBase* factory); TearDownTestSuiteFunc tear_down_tc, TestFactoryBase* factory);
// Backward-compatible overload for ABI compatibility with v1.14.0 and earlier.
// This version takes const char* instead of std::string to avoid ABI issues
// when passing std::string by value across library boundaries.
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);
// If *pstr starts with the given prefix, modifies *pstr to be right // If *pstr starts with the given prefix, modifies *pstr to be right
// past the prefix and returns true; otherwise leaves *pstr unchanged // past the prefix and returns true; otherwise leaves *pstr unchanged
// and returns false. None of pstr, *pstr, and prefix can be NULL. // and returns false. None of pstr, *pstr, and prefix can be NULL.

View File

@ -2829,6 +2829,19 @@ TestInfo* MakeAndRegisterTestInfo(
return test_info; return test_info;
} }
// Backward-compatible overload for ABI compatibility with v1.14.0 and earlier.
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) {
// Forward to the std::string version
return MakeAndRegisterTestInfo(std::string(test_suite_name), name, type_param,
value_param, std::move(code_location),
fixture_class_id, set_up_tc, tear_down_tc,
factory);
}
void ReportInvalidTestSuiteType(const char* test_suite_name, void ReportInvalidTestSuiteType(const char* test_suite_name,
const CodeLocation& code_location) { const CodeLocation& code_location) {
Message errors; Message errors;