Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F79151062
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
Sun, Aug 25, 00:33
Size
1 KB
Mime Type
text/x-c++
Expires
Tue, Aug 27, 00:33 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
20017882
Attached To
rAKA akantu
test_gtest_main.cc
View Options
/* -------------------------------------------------------------------------- */
#include "aka_common.hh"
#include "communicator.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
));
::
testing
::
TestEventListeners
&
listeners
=
::
testing
::
UnitTest
::
GetInstance
()
->
listeners
();
if
(
::
akantu
::
Communicator
::
getStaticCommunicator
().
whoAmI
()
!=
0
)
{
delete
listeners
.
Release
(
listeners
.
default_result_printer
());
}
return
RUN_ALL_TESTS
();
}
Event Timeline
Log In to Comment