Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update tests to latest version of gtest #806

Open
brtietz opened this issue Apr 26, 2022 · 5 comments
Open

Update tests to latest version of gtest #806

brtietz opened this issue Apr 26, 2022 · 5 comments

Comments

@brtietz
Copy link
Collaborator

brtietz commented Apr 26, 2022

In https://github.com/NREL/ssc/runs/6181437239?check_suite_focus=true, the tests failed due to an incompatibility with the latest version of gtest with the following error:

In file included from /Users/runner/work/ssc/ssc/ssc/test/ssc_test/cmod_tcstrough_empirical_test.cpp:23:
In file included from /Users/runner/work/ssc/ssc/googletest/googletest/include/gtest/gtest.h:60:
In file included from /Users/runner/work/ssc/ssc/googletest/googletest/include/gtest/gtest-death-test.h:43:
In file included from /Users/runner/work/ssc/ssc/googletest/googletest/include/gtest/internal/gtest-death-test-internal.h:46:
In file included from /Users/runner/work/ssc/ssc/googletest/googletest/include/gtest/gtest-matchers.h:48:
In file included from /Users/runner/work/ssc/ssc/googletest/googletest/include/gtest/gtest-printers.h:114:
/Users/runner/work/ssc/ssc/googletest/googletest/include/gtest/internal/gtest-internal.h:477:40: error: cannot initialize return object of type 'testing::Test *' with an rvalue of type 'csp_trough_EmpiricalTroughCmod_Phoenix_NoFinancial_Test '
Test
CreateTest() override { return new TestClass; }
^~~
/Users/runner/work/ssc/ssc/ssc/test/ssc_test/cmod_tcstrough_empirical_test.cpp:233:1: note: in instantiation of member function 'testing::internal::TestFactoryImpl<csp_trough_EmpiricalTroughCmod_Phoenix_NoFinancial_Test>::CreateTest' requested here
NAMESPACE_TEST(csp_trough, EmpiricalTroughCmod, Phoenix_NoFinancial)
^
/Users/runner/work/ssc/ssc/ssc/test/shared_test/vs_google_test_explorer_namespace.h:45:3: note: expanded from macro 'NAMESPACE_TEST'
NAMESPACE_GTEST_TEST_(namespace_name, test_case_name, test_name,
^
/Users/runner/work/ssc/ssc/ssc/test/shared_test/vs_google_test_explorer_namespace.h:38:13: note: expanded from macro 'NAMESPACE_GTEST_TEST_'
new ::testing::internal::TestFactoryImpl<
^
16 errors generated.

The short term fix was to pin the version of gtest at the last version that worked: #804

This issue covers the long term fix: rewriting our tests to remove the errors.

@dguittet
Copy link
Collaborator

dguittet commented Dec 7, 2023

This is resolved in #1035

@tyneises
Copy link
Collaborator

tyneises commented Dec 8, 2023

@dguittet can we update Step 4 in the build instructions? https://github.com/NREL/SAM/wiki/Windows-Build-Instructions

@brtietz
Copy link
Collaborator Author

brtietz commented Dec 8, 2023

That's tricky - 1035 is going to go into develop for the 2024 release, but the issue will still exist on patch (current develop). Is there a way to cherry-pick the fix to the current branch?

@brtietz brtietz assigned dguittet and unassigned Matthew-Boyd Dec 8, 2023
@dguittet
Copy link
Collaborator

dguittet commented Dec 8, 2023

I think it'll be possible to isolate the fix for patch

@dguittet
Copy link
Collaborator

dguittet commented Dec 8, 2023

@tyneises I don't think we can change the googletest version until this has been merged though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants