Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F99923559
test_gtest_main.cc
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Jan 27, 07:31
Size
1 KB
Mime Type
text/x-c++
Expires
Wed, Jan 29, 07:31 (1 d, 4 h)
Engine
blob
Format
Raw Data
Handle
23723749
Attached To
rAKA akantu
test_gtest_main.cc
View Options
/* -------------------------------------------------------------------------- */
#include "aka_common.hh"
/* -------------------------------------------------------------------------- */
#include <gtest/gtest.h>
#if defined(AKANTU_TEST_USE_PYBIND11)
#include <pybind11/embed.h>
namespace py = pybind11;
#endif
/* -------------------------------------------------------------------------- */
namespace {
class AkaEnvironment : public ::testing::Environment {
public:
AkaEnvironment(int & argc, char **& argv) : argc(argc), argv(argv) {}
// Override this to define how to set up the environment.
void SetUp() override {
::akantu::initialize(argc, argv);
#if defined(AKANTU_USE_PYBIND11)
//py::initialize_interpreter();
#endif
}
// Override this to define how to tear down the environment.
void TearDown() override {
::akantu::finalize();
#if defined(AKANTU_USE_PYBIND11)
//py::finalize_interpreter();
#endif
}
protected:
int & argc;
char **& argv;
};
}
int main(int argc, char ** argv) {
#if defined(AKANTU_TEST_USE_PYBIND11)
py::scoped_interpreter guard{};
#endif
::testing::InitGoogleTest(&argc, argv);
::testing::AddGlobalTestEnvironment(new AkaEnvironment(argc, argv));
return RUN_ALL_TESTS();
}
Event Timeline
Log In to Comment