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)
13
13
include (ExternalProject )
14
14
ExternalProject_Add (googletest
15
15
GIT_REPOSITORY https://github.com/google/googletest.git
16
- GIT_TAG release-1.8.0
16
+ GIT_TAG release-1.8.1
17
17
SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR} /googletest-src"
18
18
BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR} /googletest-build"
19
19
CONFIGURE_COMMAND ""
Original file line number Diff line number Diff line change 6
6
* The full license is in the file LICENSE, distributed with this software. *
7
7
****************************************************************************/
8
8
9
- // Required to avoid the error "std does not have memeber copysign"
9
+ // Required to avoid the error "std does not have member copysign"
10
10
#include < cmath>
11
- #include < Python.h>
12
11
13
- #include " pybind11/numpy.h"
12
+ #include " gtest/gtest.h"
13
+
14
+ #include < pybind11/embed.h>
14
15
15
16
#define FORCE_IMPORT_ARRAY
16
17
#include " xtensor-python/pyarray.hpp"
17
18
18
- #include " gtest/gtest.h"
19
- #include < iostream>
19
+ namespace py = pybind11;
20
20
21
21
int main (int argc, char * argv[])
22
22
{
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{} ;
25
25
xt::import_numpy ();
26
26
::testing::InitGoogleTest (&argc, argv);
27
27
28
28
// Run test suite
29
29
int ret = RUN_ALL_TESTS ();
30
30
31
- // Closure of the Python interpreter
32
- Py_Finalize ();
31
+ // Return test results
33
32
return ret;
34
33
}
35
34
You can’t perform that action at this time.
0 commit comments