Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(5511)

Issue 5037046: Fix 1477: Add (ly:expect-warning msg args) to suppress expected warnings (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 7 months ago by Reinhold
Modified:
12 years, 7 months ago
CC:
lilypond-devel_gnu.org
Visibility:
Public.

Description

If a file contains (ly:expect-warning ....), the corresponding warning string will be added to a list of expected warnings. If the corresponding warning (or error) is triggered, it will not be printed to stderr, but the string will be removed from the list. So, each ly:expect-warning, suppresses exactly one occurrence of the warning. To suppress a warning multiple times, call ly:expect-warning multiple times. After one file is processed, the list of expected warnings is checked. If it is not empty, it means that an expected warning was not triggered, which might be a bug. So we print out a warning message about this fact. This allows the regtests to check proper warning messages, without polluting the console output with those warning messages. All warnings that are actually printed in the regtests are a bug. For translated error message, there are two approaches: If the warning is created from scheme, simply use (ly:expect-warning (_ "msg with ~a") "args") If the message is triggered from C++, the translated string is in printf syntax, so we need to translate that and then convert it into a format string for Scheme. This can be done with the new function ly:translate-cpp-warning-scheme instead of _: (ly:expect-warning (ly:translate-cpp-warning-scheme "msg with %s") "args") This patch also adapts all regtests that are supposed to print warnings to this new approach. After this patch is applied, the only warnings/errors that are printed out by a regtest run are warnings/errors that should NOT be there (with the exception of warn-expected-warning-missing.ly).

Patch Set 1 #

Patch Set 2 : Rebased to patch 5032048 #

Patch Set 3 : ly:expect-warning now suppresses (and requires) exactly 1 warning; adapt all regtests" #

Patch Set 4 : Some more regtests had expected warnings/errors #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+267 lines, -17 lines) Patch
M flower/include/warn.hh View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M flower/warn.cc View 1 2 3 chunks +63 lines, -4 lines 0 comments Download
M input/regression/beam-quarter.ly View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M input/regression/bom-mark.ly View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M input/regression/clef-warn.ly View 1 2 1 chunk +3 lines, -0 lines 0 comments Download
M input/regression/glissando-no-break.ly View 1 2 3 1 chunk +5 lines, -1 line 0 comments Download
M input/regression/harp-pedals.ly View 1 2 1 chunk +10 lines, -0 lines 0 comments Download
M input/regression/harp-pedals-sanity-checks.ly View 1 2 1 chunk +5 lines, -0 lines 0 comments Download
M input/regression/header-cyclic-reference.ly View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M input/regression/incompatible-stem-warning.ly View 1 2 1 chunk +17 lines, -0 lines 0 comments Download
M input/regression/invalid-engraver.ly View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M input/regression/loglevels.ly View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M input/regression/lyric-combine-empty-warning.ly View 1 2 2 chunks +3 lines, -1 line 0 comments Download
M input/regression/markup-brace-warning.ly View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M input/regression/markup-cyclic-reference.ly View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M input/regression/markup-depth-non-terminating.ly View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M input/regression/markup-music-glyph.ly View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M input/regression/page-break-warn-forbidden.ly View 1 2 3 2 chunks +5 lines, -2 lines 0 comments Download
M input/regression/page-spacing-system-count-overfull.ly View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M input/regression/page-turn-page-breaking-badturns.ly View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M input/regression/paper-margins-consistency.ly View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M input/regression/paper-margins-overrun.ly View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M input/regression/phrasing-slur-multiple.ly View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M input/regression/repeat-unfold.ly View 1 2 2 chunks +3 lines, -2 lines 0 comments Download
M input/regression/repeat-volta.ly View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M input/regression/skiptypesetting-all-true.ly View 1 2 3 1 chunk +8 lines, -0 lines 0 comments Download
M input/regression/skiptypesetting-bar-check.ly View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M input/regression/slur-multiple.ly View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M input/regression/slur-multiple-linebreak.ly View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M input/regression/spacing-loose-grace-error.ly View 1 2 3 2 chunks +7 lines, -4 lines 0 comments Download
M input/regression/stem-tremolo.ly View 1 2 2 chunks +5 lines, -3 lines 1 comment Download
M input/regression/tablature-negative-fret.ly View 1 2 1 chunk +9 lines, -0 lines 0 comments Download
M input/regression/tablature-zero-finger.ly View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M input/regression/tie-arpeggio.ly View 1 2 1 chunk +2 lines, -0 lines 1 comment Download
M input/regression/tie-unterminated.ly View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M input/regression/warn-conflicting-key-signatures.ly View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
A input/regression/warn-expected-warning-missing.ly View 1 2 1 chunk +12 lines, -0 lines 0 comments Download
M input/regression/warn-unterminated-span-dynamic.ly View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M lily/warn-scheme.cc View 1 2 2 chunks +71 lines, -0 lines 0 comments Download
M scm/lily.scm View 1 2 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 10
pkx166h
Passes make and reg tests look ok but I guess someone who really knows should ...
12 years, 7 months ago (2011-09-24 07:02:47 UTC) #1
Graham Percival (old account)
Looks mostly good. I would have preferred to have the code changes in a separate ...
12 years, 7 months ago (2011-09-27 04:32:35 UTC) #2
MikeSol
LGTM It'd be great to see the regtests run with -dwarning-as-error now that you've done ...
12 years, 7 months ago (2011-09-28 07:07:12 UTC) #3
reinhold_kainhofer.com
Am Wednesday, 28. September 2011, 09:07:12 schrieben Sie: > LGTM > > It'd be great ...
12 years, 7 months ago (2011-09-28 09:45:30 UTC) #4
mike_apollinemike.com
On Sep 28, 2011, at 11:45 AM, Reinhold Kainhofer wrote: > Am Wednesday, 28. September ...
12 years, 7 months ago (2011-09-28 09:54:49 UTC) #5
reinhold_kainhofer.com
Am Wednesday, 28. September 2011, 11:54:38 schrieb mike@apollinemike.com: > On Sep 28, 2011, at 11:45 ...
12 years, 7 months ago (2011-09-28 10:35:58 UTC) #6
reinhold_kainhofer.com
Am Wednesday, 28. September 2011, 12:35:55 schrieb Reinhold Kainhofer: > Am Wednesday, 28. September 2011, ...
12 years, 7 months ago (2011-09-28 10:46:17 UTC) #7
Graham Percival
On Wed, Sep 28, 2011 at 12:35:55PM +0200, Reinhold Kainhofer wrote: > Am Wednesday, 28. ...
12 years, 7 months ago (2011-09-28 10:52:43 UTC) #8
mike_apollinemike.com
On Sep 28, 2011, at 12:35 PM, Reinhold Kainhofer wrote: > Am Wednesday, 28. September ...
12 years, 7 months ago (2011-09-28 11:03:33 UTC) #9
Reinhold
12 years, 7 months ago (2011-09-29 10:01:26 UTC) #10
Pushed as commits 
1ecdd56060e34a00b2be6b38029b286a601ea6f8 (code changes)
b8e19438b2d69674efcf408586950e384d5e4b06  (regtest changes)
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b