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
Post a Comment