-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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 new style #963
Conversation
9fc2741
to
7c1ea72
Compare
3240811
to
ca0fa8c
Compare
This PR broke the current I spent some time fighting with MSVC to get it to work, and finally settled on e4fb05a, which manages to simplify it, fix the ICEs on MSVC and clang, and makes it C++11-compatible. I came on the really weird trick to making it work accidentally: dropping the defaulted @dean0x7d - do we need the |
ca0fa8c
to
588abdb
Compare
The solution in e4fb05a will not work for overload sets which have a variable number of arguments, e.g. The |
Rats. I think we may have to switch off |
588abdb
to
b8b95e6
Compare
I think I've found a fix (for the original |
152bdcc
to
8e3e94c
Compare
The current `py::overload_cast` is hitting some ICEs under both MSVC 2015 and clang 3.8 on debian with the rewritten test suites; adding an empty constexpr constructor to the `overload_cast_impl` class seems to avoid the ICE.
This udpates all the remaining tests to the new test suite code and comment styles started in pybind#898. For the most part, the test coverage here is unchanged, with a few minor exceptions as noted below. - test_constants_and_functions: this adds more overload tests with overloads with different number of arguments for more comprehensive overload_cast testing. The test style conversion broke the overload tests under MSVC 2015, prompting the additional tests while looking for a workaround. - test_eigen: this dropped the unused functions `get_cm_corners` and `get_cm_corners_const`--these same tests were duplicates of the same things provided (and used) via ReturnTester methods. - test_opaque_types: this test had a hidden dependence on ExampleMandA which is now fixed by using the global UserType which suffices for the relevant test. - test_methods_and_attributes: this required some additions to UserType to make it usable as a replacement for the test's previous SimpleType: UserType gained a value mutator, and the `value` property is not mutable (it was previously readonly). Some overload tests were also added to better test overload_cast (as described above). - test_numpy_array: removed the untemplated mutate_data/mutate_data_t: the templated versions with an empty parameter pack expand to the same thing. - test_stl: this was already mostly in the new style; this just tweaks things a bit, localizing a class, and adding some missing `// test_whatever` comments. - test_virtual_functions: like `test_stl`, this was mostly in the new test style already, but needed some `// test_whatever` comments. This commit also moves the inherited virtual example code to the end of the file, after the main set of tests (since it is less important than the other tests, and rather length); it also got renamed to `test_inherited_virtuals` (from `test_inheriting_repeat`) because it tests both inherited virtual approaches, not just the repeat approach.
8e3e94c
to
1a3bb42
Compare
This updates the test suite tests to the new style proposed and started in #898. This is still in progress. (I'm adding commits one-by-one for now, but intend to merge them all into one before merging onto
master
).(Also note that
test_exceptions
andtest_multiple_inheritance
won't be included here—they are covered by PRs #954 and #960, respectively.)