mirror of
https://github.com/thelsing/knx.git
synced 2026-02-23 13:50:35 +01:00
clean up visual studio files and add root cmake
This commit is contained in:
@@ -1,22 +0,0 @@
|
||||
// The Catch implementation is compiled here. This is a standalone
|
||||
// translation unit to avoid recompiling it for every test change.
|
||||
|
||||
#include <pybind11/embed.h>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
// Silence MSVC C++17 deprecation warning from Catch regarding std::uncaught_exceptions (up to catch
|
||||
// 2.0.1; this should be fixed in the next catch release after 2.0.1).
|
||||
# pragma warning(disable: 4996)
|
||||
#endif
|
||||
|
||||
#define CATCH_CONFIG_RUNNER
|
||||
#include <catch.hpp>
|
||||
|
||||
namespace py = pybind11;
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
py::scoped_interpreter guard{};
|
||||
auto result = Catch::Session().run(argc, argv);
|
||||
|
||||
return result < 0xff ? result : 0xff;
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
#include <pybind11/pybind11.h>
|
||||
|
||||
namespace py = pybind11;
|
||||
|
||||
/* Simple test module/test class to check that the referenced internals data of external pybind11
|
||||
* modules aren't preserved over a finalize/initialize.
|
||||
*/
|
||||
|
||||
PYBIND11_MODULE(external_module, m) {
|
||||
class A {
|
||||
public:
|
||||
A(int value) : v{value} {};
|
||||
int v;
|
||||
};
|
||||
|
||||
py::class_<A>(m, "A")
|
||||
.def(py::init<int>())
|
||||
.def_readwrite("value", &A::v);
|
||||
|
||||
m.def("internals_at", []() {
|
||||
return reinterpret_cast<uintptr_t>(&py::detail::get_internals());
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user