-
-
Notifications
You must be signed in to change notification settings - Fork 189
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
Feature/1886 /test utility cleanup - part 1 #1895
Conversation
…4.1 (tags/RELEASE_600/final)
…s/RELEASE_600/final)
This reverts commit 1ab2f2f. # Conflicts: # test/unit/util.hpp
…4.1 (tags/RELEASE_600/final)
…4.1 (tags/RELEASE_600/final)
…s/RELEASE_600/final)
This is ready for review. |
Thank you for putting this together! Some things that should be part of this PR:
Otherwise, this is great. I'll give it a code-review soon. |
Jenkins Console Log Machine informationProductName: Mac OS X ProductVersion: 10.11.6 BuildVersion: 15G22010CPU: G++: Clang: |
Jenkins Console Log Machine informationProductName: Mac OS X ProductVersion: 10.11.6 BuildVersion: 15G22010CPU: G++: Clang: |
I agree. Will add a section to the wiki and once that is ready will formally request your review here on the PR. |
@syclik I updated the wiki: https://github.com/stan-dev/math/wiki/Developer-Doc#writing-tests (the text assumes this PR gets merged) and also added the doxygen to the util file. I am waiting for #1865 to get merged so we can also use the util file there. Other than that this is ready for review. |
…4.1 (tags/RELEASE_600/final)
Jenkins Console Log Machine informationProductName: Mac OS X ProductVersion: 10.11.6 BuildVersion: 15G22010CPU: G++: Clang: |
Jenkins Console Log Machine informationProductName: Mac OS X ProductVersion: 10.11.6 BuildVersion: 15G22010CPU: G++: Clang: |
@syclik do you have time to review this PR this week? No problem if not, just so I know. |
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.
Thank you for the work! There’s just a question with the Eigen plugins header. There was a change that I didn’t know if it was supposed to be part of this PR.
Thanks for documenting the macros!!!!
@@ -53,14 +53,14 @@ struct val_Op{ | |||
//Returns value from a vari* | |||
template<typename T = Scalar> | |||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE | |||
std::enable_if_t<std::is_pointer<T>::value, reverse_return_t<T>> | |||
std::enable_if_t<std::is_pointer<T>::value, const double&> |
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.
Were these changes intentionally part of this PR?
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.
Yes, this was a bug. I mention it in the top-level comment: "This also fixes an issue with returning a non-const ref in eigen_plugin.h.".
Basically this should return a const ref, not a non-const.
Bumping this. No real rush, but I would like to proceed with the rest of test cleanup PRs I have lined up. Once the cleanup is done we can do some optimization of the testing to make it a lot quicker with the same test coverage. |
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.
Thanks!
Sorry, I missed that you had replied; feel free to ping me directly if it looks like I missed a comment. |
No problem, I dont like to bug people to much :) Thanks! |
Bugfix/develop after #1895
Summary
Addresses the first part of #1886 by defining the following macros:
These are all defined in
test/unit/util.hpp
. This PR removes all the duplicate definitions of these macros in various test files and removes theexpect_std_vector_eq
andexpect_matrix_eq
functions in favor of the macros.This also fixes an issue with returning a non-const ref in eigen_plugin.h.
Tests
/
Side Effects
/
Release notes
Unified EXPECT_MATRIX_* and EXPECT_STD_VECTOR_* macros in the Math unit tests.
Checklist
Math issue Organize and cleanup the use of utils in test/ #1886
Copyright holder: Rok Češnovar
The copyright holder is typically you or your assignee, such as a university or company. By submitting this pull request, the copyright holder is agreeing to the license the submitted work under the following licenses:
- Code: BSD 3-clause (https://opensource.org/licenses/BSD-3-Clause)
- Documentation: CC-BY 4.0 (https://creativecommons.org/licenses/by/4.0/)
the basic tests are passing
./runTests.py test/unit
)make test-headers
)make test-math-dependencies
)make doxygen
)make cpplint
)the code is written in idiomatic C++ and changes are documented in the doxygen
the new changes are tested