@@ -42,6 +42,7 @@ def get_file_reference(self):
4242 ]),
4343 (BoostTestFacade (), 'boost_success' , ['boost_success' ]),
4444 (BoostTestFacade (), 'boost_error' , ['boost_error' ]),
45+ (BoostTestFacade (), 'boost_fixture_setup_error' , ['boost_fixture_setup_error' ]),
4546])
4647def test_list_tests (facade , name , expected , exes ):
4748 obtained = facade .list_tests (exes .get (name ))
@@ -134,6 +135,18 @@ def test_boost_error(exes):
134135 assert fail2 .get_file_reference () == ("unknown location" , 0 )
135136
136137
138+ def test_boost_fixture_setup_error (exes ):
139+ facade = BoostTestFacade ()
140+ failures = facade .run_test (exes .get ('boost_fixture_setup_error' ), '<unused>' )
141+ assert len (failures ) == 1
142+
143+ fail1 = failures [0 ]
144+ colors = ('red' , 'bold' )
145+ assert fail1 .get_lines () == [
146+ ('Test setup error: std::runtime_error: This is a global fixture init failure' , colors )]
147+ assert fail1 .get_file_reference () == ("unknown location" , 0 )
148+
149+
137150def test_google_run (testdir , exes ):
138151 result = testdir .inline_run ('-v' , exes .get ('gtest' , 'test_gtest' ))
139152 assert_outcomes (result , [
@@ -179,12 +192,13 @@ def raise_error(*args, **kwargs):
179192
180193
181194def test_boost_run (testdir , exes ):
182- all_names = ['boost_success' , 'boost_error' , 'boost_failure' ]
195+ all_names = ['boost_success' , 'boost_error' , 'boost_fixture_setup_error' , ' boost_failure' ]
183196 all_files = [exes .get (n , 'test_' + n ) for n in all_names ]
184197 result = testdir .inline_run ('-v' , * all_files )
185198 assert_outcomes (result , [
186199 ('test_boost_success' , 'passed' ),
187200 ('test_boost_error' , 'failed' ),
201+ ('test_boost_fixture_setup_error' , 'failed' ),
188202 ('test_boost_failure' , 'failed' ),
189203 ])
190204
0 commit comments