-
Notifications
You must be signed in to change notification settings - Fork 4
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
Convert unit tests to googletest #200
Conversation
@spahrenk this looks good to me. A lot of unrelated cleanup here too that should maybe be in a separate branch, but it's not worth the effort to separate it out now. The source file in the companion CSE branch been completely reformatted, making it impossible to see where the API has caused changes. This highlights the need to get clang formatting set up in CSE, but for now, can you change the branch with your "autoformat" turned off? |
Ah, OK. I'll clean that up. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #200 +/- ##
==========================================
+ Coverage 66.08% 66.78% +0.71%
==========================================
Files 6 6
Lines 4979 5157 +178
==========================================
+ Hits 3290 3444 +154
- Misses 1689 1713 +24
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
CMakeLists.txt
Outdated
@@ -46,7 +46,8 @@ add_subdirectory(vendor) | |||
add_subdirectory(src) | |||
|
|||
if (${PROJECT_NAME}_BUILD_TESTING) | |||
add_subdirectory(test) | |||
add_subdirectory(test/unit_tests) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One very minor change here: This subdirectory should be added from the test/CMakeLists.txt.
Description
googletest
within a separate project saved in test/unit_tests. These unit tests are run along with extant model tests via RUN_TESTS:Build.HPWHsim
was changed to use $(PROJECT_NAME) (currently set asHPWHsim
) as the name of the compiled library, rather thanlibHPWHSim
. The corresponding change was made in a cse branchadd-unit-tests-hpwh
.testUtilityFcts.cc
was removed entirely. Code within that file was either redundant, no longer needed, or changed to HPWH member functions. The functiongetHPWHObject
was changed to an overloaded version ofHPWH::initPreset
using a string argument. Some function names were altered slightly for clarity.HPWH::initPreset
. (Alternatively, model modifiers could be used to distinguish these, which seemed outside the scope of this PR.) The non-member functionscaleVector
was added to perform the scaling. These submodel numbers remain undefined in cse.HPWH
tests are passed in their new forms.cse
branch passes all tests.Author Progress Checklist:
Reviewer Checklist: