File tree Expand file tree Collapse file tree 2 files changed +9
-10
lines changed
Expand file tree Collapse file tree 2 files changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ project(googletest-download NONE)
1313include (ExternalProject)
1414ExternalProject_Add(googletest
1515 GIT_REPOSITORY https://github.com/google/googletest.git
16- GIT_TAG release-1.8.0
16+ GIT_TAG release-1.8.1
1717 SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR} /googletest-src"
1818 BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR} /googletest-build"
1919 CONFIGURE_COMMAND ""
Original file line number Diff line number Diff line change 66* The full license is in the file LICENSE, distributed with this software. *
77****************************************************************************/
88
9- // Required to avoid the error "std does not have memeber copysign"
9+ // Required to avoid the error "std does not have member copysign"
1010#include < cmath>
11- #include < Python.h>
1211
13- #include " pybind11/numpy.h"
12+ #include " gtest/gtest.h"
13+
14+ #include < pybind11/embed.h>
1415
1516#define FORCE_IMPORT_ARRAY
1617#include " xtensor-python/pyarray.hpp"
1718
18- #include " gtest/gtest.h"
19- #include < iostream>
19+ namespace py = pybind11;
2020
2121int main (int argc, char * argv[])
2222{
23- // Initialize all the things (google-test and Python interpreter )
24- Py_Initialize () ;
23+ // Initialize all the things (Python, numpy, gtest )
24+ py::scoped_interpreter guard{} ;
2525 xt::import_numpy ();
2626 ::testing::InitGoogleTest (&argc, argv);
2727
2828 // Run test suite
2929 int ret = RUN_ALL_TESTS ();
3030
31- // Closure of the Python interpreter
32- Py_Finalize ();
31+ // Return test results
3332 return ret;
3433}
3534
You can’t perform that action at this time.
0 commit comments