mirror of
https://github.com/google/googletest.git
synced 2025-01-14 16:37:56 +08:00
Googletest export
Standardize access to GoogleTest flags on GTEST_FLAG_GET/GTEST_FLAG_SET Custom implementations can decide how access to flags is performed depending on the implementation of flags being used. PiperOrigin-RevId: 388181424
This commit is contained in:
parent
29d2540622
commit
c22ce88775
@ -568,12 +568,12 @@ restored afterwards, so you need not do that yourself. For example:
|
|||||||
```c++
|
```c++
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
testing::InitGoogleTest(&argc, argv);
|
testing::InitGoogleTest(&argc, argv);
|
||||||
testing::FLAGS_gtest_death_test_style = "fast";
|
GTEST_FLAG_SET(gtest_death_test_style, "fast");
|
||||||
return RUN_ALL_TESTS();
|
return RUN_ALL_TESTS();
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(MyDeathTest, TestOne) {
|
TEST(MyDeathTest, TestOne) {
|
||||||
testing::FLAGS_gtest_death_test_style = "threadsafe";
|
GTEST_FLAG_SET(gtest_death_test_style, "threadsafe");
|
||||||
// This test is run in the "threadsafe" style:
|
// This test is run in the "threadsafe" style:
|
||||||
ASSERT_DEATH(ThisShouldDie(), "");
|
ASSERT_DEATH(ThisShouldDie(), "");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user