File tree Expand file tree Collapse file tree 3 files changed +27
-4
lines changed Expand file tree Collapse file tree 3 files changed +27
-4
lines changed Original file line number Diff line number Diff line change 3535 plugins = ["xdist" ])
3636 if (r != 0 ):
3737 exit (r )
38- if not utility .isSanitizerRun ():
38+ if not utility .isTsanRun ():
3939 r = pytest .main (
4040 [
4141 "--rootdir=" + path ,
Original file line number Diff line number Diff line change @@ -33,13 +33,31 @@ def parseUrisToSocketAddress(uris: list[str]) -> list[SocketAddress]:
3333 return addresses
3434
3535
36+ def isTsanRun ():
37+ """Determine if current execution is tsan.
38+
39+ Returns:
40+ bool: True iff the current execution is determined to be a sanitizer run.
41+ """
42+ return True if os .environ .get ("NH_INTEGRATION_TEST_THREAD_SANITIZER_RUN" , 0 ) == "1" else False
43+
44+
45+ def isAsanRun ():
46+ """Determine if current execution is asan.
47+
48+ Returns:
49+ bool: True iff the current execution is determined to be a sanitizer run.
50+ """
51+ return True if os .environ .get ("NH_INTEGRATION_TEST_ADDRESS_SANITIZER_RUN" , 0 ) == "1" else False
52+
53+
3654def isSanitizerRun ():
3755 """Determine if the current execution is a tsan/asan/ubsan run.
3856
3957 Returns:
4058 bool: True iff the current execution is determined to be a sanitizer run.
4159 """
42- return True if os . environ . get ( "NH_INTEGRATION_TEST_SANITIZER_RUN" , 0 ) == "1" else False
60+ return True if isTsanRun () or isAsanRun () else False
4361
4462
4563def run_binary_with_args (binary , args ):
Original file line number Diff line number Diff line change @@ -13,8 +13,13 @@ class PythonTest : public Test {};
1313// of getting code coverage reporting to also consider the code hit by integration tests.
1414TEST_F (PythonTest, IntegrationTests) {
1515 const std::string path = TestEnvironment::runfilesPath (" test/integration/integration_test" );
16- #if defined(__has_feature) && (__has_feature(thread_sanitizer) || __has_feature(address_sanitizer))
17- char env[] = " NH_INTEGRATION_TEST_SANITIZER_RUN=1" ;
16+ #if defined(__has_feature) && (__has_feature(address_sanitizer))
17+ char env[] = " NH_INTEGRATION_TEST_ADDRESS_SANITIZER_RUN=1" ;
18+ putenv (env);
19+ #endif
20+
21+ #if defined(__has_feature) && (__has_feature(thread_sanitizer))
22+ char env[] = " NH_INTEGRATION_TEST_THREAD_SANITIZER_RUN=1" ;
1823 putenv (env);
1924#endif
2025 ASSERT_EQ (0 , system (path.c_str ()));
You can’t perform that action at this time.
0 commit comments