MCPcopy
hub / github.com/stretchr/testify / TestFailfastSuite

Function TestFailfastSuite

suite/suite_test.go:597–621  ·  suite/suite_test.go::TestFailfastSuite
(t *testing.T)

Source from the content-addressed store, hash-verified

595}
596
597func 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
623type tHelper interface {
624 Helper()

Callers

nothing calls this directly

Calls 5

FalseFunction · 0.92
RunFunction · 0.85
callOrderAssertFunction · 0.85
GetMethod · 0.80
NameMethod · 0.65

Tested by

no test coverage detected