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

Function TestCheckmake_RunWithViolations

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

Source from the content-addressed store, hash-verified

76}
77
78func TestCheckmake_RunWithViolations(t *testing.T) {
79 cmd := newRootCmd()
80 cmd.SilenceErrors = true
81 cmd.SetArgs([]string{"../../fixtures/missing_phony.make"})
82
83 var err error
84 out := captureOutput(func() {
85 err = cmd.Execute()
86 })
87
88 require.Error(t, err, "expected command to fail for a makefile with violations")
89
90 // matching full sentences with table output is complex, search partially
91 assert.Contains(t, out, "Required target", "should mention violation description")
92 assert.Contains(t, out, "declared PHONY.", "should mention target type")
93 assert.Contains(t, out, "phonydeclared", "should mention phonydeclared error")
94}
95
96func TestCheckmake_ListRules(t *testing.T) {
97 t.Parallel()

Callers

nothing calls this directly

Calls 2

newRootCmdFunction · 0.85
captureOutputFunction · 0.85

Tested by

no test coverage detected