c++ - How to suppress runtime errors caused by assert() using google test? -



c++ - How to suppress runtime errors caused by assert() using google test? -

i using google test in c++ project. functions utilize assert() in order check invalid input parameters. read death-tests (what google test, death tests) , started using them in test cases.

however, wonder if there way suppress runtime errors caused failing assertions. @ time each failing assertion creates pop-up window have close everytime run tests. project grows, behaviour increasingly disturbs workflow in unacceptable way , tend not test assert()-assertions longer. know there possibilities disable assertions in general, seems more convenient suppress os-generated warnings within testing framework.

ok, found solution myself: have select test-style threadsafe. add together next line test code:

::testing::flags_gtest_death_test_style = "threadsafe";

you can either tests in test-binary or affected tests only. latter faster. got updated faq: googletest advancedguide

c++ assert runtime-error googletest

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -