(t *testing.T)
| 595 | } |
| 596 | |
| 597 | func TestFailfastSuite(t *testing.T) { |
| 598 | // This test suite is run twice. Once normally and once with the -failfast flag by TestFailfastSuiteFailFastOn |
| 599 | // If you need to debug it run this test directly with the failfast flag set on/off as you need |
| 600 | failFast := flag.Lookup("test.failfast").Value.(flag.Getter).Get().(bool) |
| 601 | s := new(FailfastSuite) |
| 602 | ok := testing.RunTests( |
| 603 | allTestsFilter, |
| 604 | []testing.InternalTest{{ |
| 605 | Name: t.Name() + "/FailfastSuite", |
| 606 | F: func(t *testing.T) { |
| 607 | Run(t, s) |
| 608 | }, |
| 609 | }}, |
| 610 | ) |
| 611 | assert.False(t, ok) |
| 612 | var expect []string |
| 613 | if failFast { |
| 614 | // Test A Fails and because we are running with failfast Test B never runs and we proceed straight to TearDownSuite |
| 615 | expect = []string{"SetupSuite", "SetupTest", "Test A Fails", "TearDownTest", "TearDownSuite"} |
| 616 | } else { |
| 617 | // Test A Fails and because we are running without failfast we continue and run Test B and then proceed to TearDownSuite |
| 618 | expect = []string{"SetupSuite", "SetupTest", "Test A Fails", "TearDownTest", "SetupTest", "Test B Passes", "TearDownTest", "TearDownSuite"} |
| 619 | } |
| 620 | callOrderAssert(t, expect, s.callOrder) |
| 621 | } |
| 622 | |
| 623 | type tHelper interface { |
| 624 | Helper() |
nothing calls this directly
no test coverage detected