Commit 920e0e34 authored by Jason Rhinelander's avatar Jason Rhinelander Committed by Wenzel Jakob
Browse files

Add cmake option to override tests (#489)

When working on some particular feature, it's nice to be able to disable
all the tests except for the one I'm working on; this is currently
possible by editing tests/CMakeLists.txt, and commenting out the tests
you don't want.

This commit goes a step further by letting you give a list of tests you
do want when invoking cmake, e.g.:

    cmake -DPYBIND11_TEST_OVERRIDE="test_issues.cpp;test_pickling.cpp" ..

changes the build to build just those two tests (and changes the `pytest`
target to invoke just the two associated tests).

This persists in the build directory until you disable it again by
running cmake with `-DPYBIND11_TEST_OVERRIDE=`.  It also adds a message
after the pytest output to remind you that it is in effect:

    Note: not all tests run: -DPYBIND11_TEST_OVERRIDE is in effect
parent 5e1c0445
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment