-
Notifications
You must be signed in to change notification settings - Fork 89
Expand file tree
/
Copy pathpython_test.cc
More file actions
28 lines (21 loc) · 864 Bytes
/
python_test.cc
File metadata and controls
28 lines (21 loc) · 864 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include "test/test_common/environment.h"
#include "gtest/gtest.h"
using namespace std::chrono_literals;
using namespace testing;
namespace Nighthawk {
class PythonTest : public Test {};
// This runs the python integration tests from within a test context, for the purpose
// of getting code coverage reporting to also consider the code hit by integration tests.
TEST_F(PythonTest, IntegrationTests) {
const std::string path = TestEnvironment::runfilesPath("test/integration/integration_test");
#if defined(__has_feature) && (__has_feature(address_sanitizer))
char env[] = "NH_INTEGRATION_TEST_ADDRESS_SANITIZER_RUN=1";
putenv(env);
#endif
#if defined(__has_feature) && (__has_feature(thread_sanitizer))
char env[] = "NH_INTEGRATION_TEST_THREAD_SANITIZER_RUN=1";
putenv(env);
#endif
ASSERT_EQ(0, system(path.c_str()));
}
} // namespace Nighthawk