1010
1111#include " rtsan_test_utilities.h"
1212
13- #include " rtsan_context.h"
13+ #include " rtsan/rtsan.h"
14+ #include " rtsan/rtsan_context.h"
1415
15- TEST (TestRtsanContext, CanCreateContext) { __rtsan::Context context{}; }
16+ # include < gtest/gtest.h >
1617
17- TEST (TestRtsanContext, ExpectNotRealtimeDoesNotDieBeforeRealtimePush) {
18+ class TestRtsanContext : public ::testing::Test {
19+ protected:
20+ void SetUp () override { __rtsan_ensure_initialized (); }
21+ };
22+
23+ TEST_F (TestRtsanContext, ExpectNotRealtimeDoesNotDieBeforeRealtimePush) {
1824 __rtsan::Context context{};
1925 ExpectNotRealtime (context, " do_some_stuff" );
2026}
2127
22- TEST (TestRtsanContext, ExpectNotRealtimeDoesNotDieAfterPushAndPop) {
28+ TEST_F (TestRtsanContext, ExpectNotRealtimeDoesNotDieAfterPushAndPop) {
2329 __rtsan::Context context{};
2430 context.RealtimePush ();
2531 context.RealtimePop ();
2632 ExpectNotRealtime (context, " do_some_stuff" );
2733}
2834
29- TEST (TestRtsanContext, ExpectNotRealtimeDiesAfterRealtimePush) {
35+ TEST_F (TestRtsanContext, ExpectNotRealtimeDiesAfterRealtimePush) {
3036 __rtsan::Context context{};
3137
3238 context.RealtimePush ();
3339 EXPECT_DEATH (ExpectNotRealtime (context, " do_some_stuff" ), " " );
3440}
3541
36- TEST (TestRtsanContext,
37- ExpectNotRealtimeDiesAfterRealtimeAfterMorePushesThanPops) {
42+ TEST_F (TestRtsanContext,
43+ ExpectNotRealtimeDiesAfterRealtimeAfterMorePushesThanPops) {
3844 __rtsan::Context context{};
3945
4046 context.RealtimePush ();
@@ -45,16 +51,16 @@ TEST(TestRtsanContext,
4551 EXPECT_DEATH (ExpectNotRealtime (context, " do_some_stuff" ), " " );
4652}
4753
48- TEST (TestRtsanContext, ExpectNotRealtimeDoesNotDieAfterBypassPush) {
54+ TEST_F (TestRtsanContext, ExpectNotRealtimeDoesNotDieAfterBypassPush) {
4955 __rtsan::Context context{};
5056
5157 context.RealtimePush ();
5258 context.BypassPush ();
5359 ExpectNotRealtime (context, " do_some_stuff" );
5460}
5561
56- TEST (TestRtsanContext,
57- ExpectNotRealtimeDoesNotDieIfBypassDepthIsGreaterThanZero) {
62+ TEST_F (TestRtsanContext,
63+ ExpectNotRealtimeDoesNotDieIfBypassDepthIsGreaterThanZero) {
5864 __rtsan::Context context{};
5965
6066 context.RealtimePush ();
0 commit comments