forked from git-town/git-town
-
Notifications
You must be signed in to change notification settings - Fork 1
/
main_test.go
55 lines (51 loc) · 1.52 KB
/
main_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package main_test
import (
"runtime"
"testing"
"github.com/cucumber/godog"
"github.com/git-town/git-town/test/steps"
)
// nolint:deadcode,unused
func FeatureContext(suite *godog.Suite) {
// The current Godog implementation only provides a FeatureContext,
// no SuiteContext nor ScenarioContext.
// Hence we have to register the scenario state here (and reuse it for all scenarios in a feature)
// and register the steps here.
// It is initialized in SuiteSteps.BeforeScenario.
state := &steps.ScenarioState{}
steps.SuiteSteps(suite, state)
steps.AutocompletionSteps(suite, state)
steps.BranchSteps(suite, state)
steps.CommitSteps(suite, state)
steps.ConfigurationSteps(suite, state)
steps.ConflictSteps(suite, state)
steps.DebugSteps(suite, state)
steps.FileSteps(suite, state)
steps.FolderSteps(suite, state)
steps.GitTownSteps(suite, state)
steps.InstallationSteps(suite, state)
steps.MergeSteps(suite, state)
steps.OfflineSteps(suite, state)
steps.OriginSteps(suite, state)
steps.PrintSteps(suite, state)
steps.RebaseSteps(suite, state)
steps.RepoSteps(suite, state)
steps.RunSteps(suite, state)
steps.WorkspaceSteps(suite, state)
steps.MergeSteps(suite, state)
steps.TagSteps(suite, state)
steps.CoworkerSteps(suite, state)
}
func TestGodog(t *testing.T) {
status := godog.RunWithOptions("godog", func(s *godog.Suite) {
FeatureContext(s)
}, godog.Options{
Format: "progress",
Concurrency: runtime.NumCPU(),
Strict: true,
Paths: []string{"features/"},
})
if status > 0 {
t.FailNow()
}
}