pybind11/tests
Jason Rhinelander 52f4be8946 Make test initialization self-registering
Adding or removing tests is a little bit cumbersome currently: the test
needs to be added to CMakeLists.txt, the init function needs to be
predeclared in pybind11_tests.cpp, then called in the plugin
initialization.  While this isn't a big deal for tests that are being
committed, it's more of a hassle when working on some new feature or
test code for which I temporarily only care about building and linking
the test being worked on rather than the entire test suite.

This commit changes tests to self-register their initialization by
having each test initialize a local object (which stores the
initialization function in a static variable).  This makes changing the
set of tests being build easy: one only needs to add or comment out
test names in tests/CMakeLists.txt.

A couple other minor changes that go along with this:

- test_eigen.cpp is now included in the test list, then removed if eigen
  isn't available.  This lets you disable the eigen tests by commenting
  it out, just like all the other tests, but keeps the build working
  without eigen eigen isn't available.  (Also, if it's commented out, we
  don't even bother looking for and reporting the building with/without
  eigen status message).

- pytest is now invoked with all the built test names (with .cpp changed
  to .py) so that it doesn't try to run tests that weren't built.
2016-09-03 17:34:41 -04:00
..
CMakeLists.txt Make test initialization self-registering 2016-09-03 17:34:41 -04:00
conftest.py Fix test suite failure without numpy and improve module init diagnostics 2016-08-25 17:08:09 +02:00
constructor_stats.h Port tests to pytest 2016-08-19 13:19:38 +02:00
object.h Replace tabs with spaces (to pass style check) 2016-08-28 14:11:38 -04:00
pybind11_tests.cpp Make test initialization self-registering 2016-09-03 17:34:41 -04:00
pybind11_tests.h Make test initialization self-registering 2016-09-03 17:34:41 -04:00
test_buffers.cpp Make test initialization self-registering 2016-09-03 17:34:41 -04:00
test_buffers.py Port tests to pytest 2016-08-19 13:19:38 +02:00
test_callbacks.cpp Make test initialization self-registering 2016-09-03 17:34:41 -04:00
test_callbacks.py Move inheritance tests into the proper file 2016-08-19 13:19:38 +02:00
test_constants_and_functions.cpp Make test initialization self-registering 2016-09-03 17:34:41 -04:00
test_constants_and_functions.py Move enum tests into a new file 2016-08-19 13:19:38 +02:00
test_eigen.cpp Make test initialization self-registering 2016-09-03 17:34:41 -04:00
test_eigen.py Fix test suite failure without numpy and improve module init diagnostics 2016-08-25 17:08:09 +02:00
test_enum.cpp Make test initialization self-registering 2016-09-03 17:34:41 -04:00
test_enum.py Move enum tests into a new file 2016-08-19 13:19:38 +02:00
test_eval_call.py Rewrite eval tests to allow for simple asserts 2016-08-19 16:31:48 +02:00
test_eval.cpp Make test initialization self-registering 2016-09-03 17:34:41 -04:00
test_eval.py Rewrite eval tests to allow for simple asserts 2016-08-19 16:31:48 +02:00
test_exceptions.cpp Make test initialization self-registering 2016-09-03 17:34:41 -04:00
test_exceptions.py Port tests to pytest 2016-08-19 13:19:38 +02:00
test_inheritance.cpp Make test initialization self-registering 2016-09-03 17:34:41 -04:00
test_inheritance.py Move inheritance tests into the proper file 2016-08-19 13:19:38 +02:00
test_issues.cpp Make test initialization self-registering 2016-09-03 17:34:41 -04:00
test_issues.py Simplify more tests by replacing capture with assert 2016-08-19 16:31:48 +02:00
test_keep_alive.cpp Make test initialization self-registering 2016-09-03 17:34:41 -04:00
test_keep_alive.py Port tests to pytest 2016-08-19 13:19:38 +02:00
test_kwargs_and_defaults.cpp Make test initialization self-registering 2016-09-03 17:34:41 -04:00
test_kwargs_and_defaults.py Simplify more tests by replacing capture with assert 2016-08-19 16:31:48 +02:00
test_methods_and_attributes.cpp Make test initialization self-registering 2016-09-03 17:34:41 -04:00
test_methods_and_attributes.py Port tests to pytest 2016-08-19 13:19:38 +02:00
test_modules.cpp Make test initialization self-registering 2016-09-03 17:34:41 -04:00
test_modules.py Simplify tests by replacing output capture with asserts where possible 2016-08-19 13:19:38 +02:00
test_numpy_dtypes.cpp Make test initialization self-registering 2016-09-03 17:34:41 -04:00
test_numpy_dtypes.py Fix test suite failure without numpy and improve module init diagnostics 2016-08-25 17:08:09 +02:00
test_numpy_vectorize.cpp Make test initialization self-registering 2016-09-03 17:34:41 -04:00
test_numpy_vectorize.py Simplify tests by replacing output capture with asserts where possible 2016-08-19 13:19:38 +02:00
test_opaque_types.cpp Make test initialization self-registering 2016-09-03 17:34:41 -04:00
test_opaque_types.py Simplify tests by replacing output capture with asserts where possible 2016-08-19 13:19:38 +02:00
test_operator_overloading.cpp Make test initialization self-registering 2016-09-03 17:34:41 -04:00
test_operator_overloading.py Port tests to pytest 2016-08-19 13:19:38 +02:00
test_pickling.cpp Make test initialization self-registering 2016-09-03 17:34:41 -04:00
test_pickling.py Port tests to pytest 2016-08-19 13:19:38 +02:00
test_python_types.cpp Make test initialization self-registering 2016-09-03 17:34:41 -04:00
test_python_types.py Port tests to pytest 2016-08-19 13:19:38 +02:00
test_sequences_and_iterators.cpp Make test initialization self-registering 2016-09-03 17:34:41 -04:00
test_sequences_and_iterators.py Add tests for generalized iterators 2016-08-24 23:30:00 +01:00
test_smart_ptr.cpp Make test initialization self-registering 2016-09-03 17:34:41 -04:00
test_smart_ptr.py Port tests to pytest 2016-08-19 13:19:38 +02:00
test_stl_binders.cpp Make test initialization self-registering 2016-09-03 17:34:41 -04:00
test_stl_binders.py Port tests to pytest 2016-08-19 13:19:38 +02:00
test_virtual_functions.cpp Make test initialization self-registering 2016-09-03 17:34:41 -04:00
test_virtual_functions.py Fix template trampoline overload lookup failure 2016-08-29 19:41:44 -04:00