MCPcopy Create free account
hub / github.com/checkmake/checkmake / TestCheckmake_WithCustomFormatFlag

Function TestCheckmake_WithCustomFormatFlag

cmd/checkmake/main_test.go:118–136  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

116}
117
118func TestCheckmake_WithCustomFormatFlag(t *testing.T) {
119 out := captureOutput(func() {
120 cmd := newRootCmd()
121 cmd.SilenceErrors = true
122 cmd.SetArgs([]string{
123 "--format", "{{.Rule}} on {{.LineNumber}}",
124 "../../fixtures/missing_phony.make",
125 })
126 _ = cmd.Execute()
127 })
128
129 t.Logf("custom format output:\n%s", out)
130
131 require.NotEmpty(t, out, "output should not be empty for custom format")
132
133 // There are three expected rules in missing_phony.make: phonydeclared and minphony twice
134 assert.Contains(t, out, "phonydeclared on 16")
135 assert.Contains(t, out, "minphony on 22")
136}
137
138func TestCheckmake_DebugLogsMakefilesPassed(t *testing.T) {
139 var logBuf bytes.Buffer

Callers

nothing calls this directly

Calls 2

captureOutputFunction · 0.85
newRootCmdFunction · 0.85

Tested by

no test coverage detected