summaryrefslogtreecommitdiff
path: root/ext/pybind11/tests/pybind11_tests.cpp
diff options
context:
space:
mode:
authorAndreas Sandberg <andreas.sandberg@arm.com>2017-05-09 19:22:53 +0100
committerAndreas Sandberg <andreas.sandberg@arm.com>2017-05-22 17:15:09 +0000
commit6914a229a038206341ae1fea46393965a555ca9a (patch)
tree4a11cfaed46dabc827c5ee17cd976f42b5f53d49 /ext/pybind11/tests/pybind11_tests.cpp
parentca1d18d599dcc620bf526fb22042af95b1b60b68 (diff)
downloadgem5-6914a229a038206341ae1fea46393965a555ca9a.tar.xz
ext: Upgrade PyBind11 to version 2.1.1
Change-Id: I16870dec402d661295f9d013dc23e362b2b2c169 Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-by: Curtis Dunham <curtis.dunham@arm.com> Reviewed-on: https://gem5-review.googlesource.com/3225 Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Diffstat (limited to 'ext/pybind11/tests/pybind11_tests.cpp')
-rw-r--r--ext/pybind11/tests/pybind11_tests.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/ext/pybind11/tests/pybind11_tests.cpp b/ext/pybind11/tests/pybind11_tests.cpp
index 9c593eee1..1d805d75b 100644
--- a/ext/pybind11/tests/pybind11_tests.cpp
+++ b/ext/pybind11/tests/pybind11_tests.cpp
@@ -10,6 +10,19 @@
#include "pybind11_tests.h"
#include "constructor_stats.h"
+/*
+For testing purposes, we define a static global variable here in a function that each individual
+test .cpp calls with its initialization lambda. It's convenient here because we can just not
+compile some test files to disable/ignore some of the test code.
+
+It is NOT recommended as a way to use pybind11 in practice, however: the initialization order will
+be essentially random, which is okay for our test scripts (there are no dependencies between the
+individual pybind11 test .cpp files), but most likely not what you want when using pybind11
+productively.
+
+Instead, see the "How can I reduce the build time?" question in the "Frequently asked questions"
+section of the documentation for good practice on splitting binding code over multiple files.
+*/
std::list<std::function<void(py::module &)>> &initializers() {
static std::list<std::function<void(py::module &)>> inits;
return inits;
@@ -32,7 +45,7 @@ void bind_ConstructorStats(py::module &m) {
}
PYBIND11_PLUGIN(pybind11_tests) {
- py::module m("pybind11_tests", "pybind example plugin");
+ py::module m("pybind11_tests", "pybind testing plugin");
bind_ConstructorStats(m);