Skip to content

Commit

Permalink
Demonstrate that -Wall implies -Werror
Browse files Browse the repository at this point in the history
  • Loading branch information
rillig committed Aug 31, 2024
1 parent 56e4dbe commit 7dcf96d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions v23/pkglint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,23 @@ func (s *Suite) Test_Pkglint_Main__profiling_error(c *check.C) {
`ERROR: pkglint\.pprof: Cannot create profiling file: open pkglint\.pprof: .*`)
}

// The option -Wall does not imply -Werror.
func (s *Suite) Test_Pkglint_Main__Wall(c *check.C) {
t := s.Init(c)

t.SetUpPackage("category/package",
"UNUSED=\tvalue")
t.Chdir("category/package")

exitcode := t.Main("-Wall")

t.CheckEquals(exitcode, 1) // FIXME
t.CheckOutputLines(
"WARN: Makefile:20: UNUSED is defined but not used.",
"1 warning found.",
"(Run \"pkglint -e -Wall\" to show explanations.)")
}

func (s *Suite) Test_Pkglint_Main__Werror_no_warning(c *check.C) {
t := s.Init(c)

Expand Down

0 comments on commit 7dcf96d

Please sign in to comment.