package main import ( "testing" "git.golem15.com/golem15/summercms/modules/backpack" "git.golem15.com/golem15/summercms/modules/bonfire" "git.golem15.com/golem15/summercms/modules/cabana" "git.golem15.com/golem15/summercms/modules/compass" "git.golem15.com/golem15/summercms/modules/conga" "git.golem15.com/golem15/summercms/modules/flare" "git.golem15.com/golem15/summercms/modules/lagoon" "git.golem15.com/golem15/summercms/modules/lighthouse/centrifugo" "git.golem15.com/golem15/summercms/modules/surf" ) // applicationCommands is every command the framework gives an application // binary, built the way docsCommands does. The blog example's blog:publish // is checked by its own package's test: the tool must not import example // plugins (TestToolDoesNotImportExamplePlugins). func applicationCommands() []bonfire.Command { app := backpack.New(&compass.Config{}) var cmds []bonfire.Command cmds = append(cmds, lagoon.RuntimeCommands(app, nil)...) cmds = append(cmds, conga.RuntimeCommands(app, nil)...) cmds = append(cmds, surf.ServeCommand(app, nil), surf.RouteListCommand(app, nil)) cmds = append(cmds, cabana.RuntimeCommands(app)...) cmds = append(cmds, centrifugo.Commands(app)...) cmds = append(cmds, flare.Commands(app)...) return cmds } // TestCommandsDocumented is the framework's documentation coverage gate // (D-17): every command of the summer tool (its delegates included) and of // an application binary has a description, long help, examples and // described arguments and options, and the test fails on any gap. func TestCommandsDocumented(t *testing.T) { commands := append(toolCommands(), applicationCommands()...) for _, problem := range bonfire.CheckDocs(commands) { t.Error(problem) } }