lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fix 1477: Add (ly:expect-warning msg args) to suppress expected warn


From: reinhold . kainhofer
Subject: Re: Fix 1477: Add (ly:expect-warning msg args) to suppress expected warnings (issue 5037046)
Date: Thu, 29 Sep 2011 10:01:26 +0000

Reviewers: J_lowe, Graham Percival, MikeSol, reinhold_kainhofer.com, mike_apollinemike.com, graham_percival-music.ca,

Message:
Pushed as commits
1ecdd56060e34a00b2be6b38029b286a601ea6f8 (code changes)
b8e19438b2d69674efcf408586950e384d5e4b06  (regtest changes)

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).


Please review this at http://codereview.appspot.com/5037046/

Affected files:
  M flower/include/warn.hh
  M flower/warn.cc
  M input/regression/beam-quarter.ly
  M input/regression/bom-mark.ly
  M input/regression/clef-warn.ly
  M input/regression/glissando-no-break.ly
  M input/regression/harp-pedals-sanity-checks.ly
  M input/regression/harp-pedals.ly
  M input/regression/header-cyclic-reference.ly
  M input/regression/incompatible-stem-warning.ly
  M input/regression/invalid-engraver.ly
  M input/regression/loglevels.ly
  M input/regression/lyric-combine-empty-warning.ly
  M input/regression/markup-brace-warning.ly
  M input/regression/markup-cyclic-reference.ly
  M input/regression/markup-depth-non-terminating.ly
  M input/regression/markup-music-glyph.ly
  M input/regression/page-break-warn-forbidden.ly
  M input/regression/page-spacing-system-count-overfull.ly
  M input/regression/page-turn-page-breaking-badturns.ly
  M input/regression/paper-margins-consistency.ly
  M input/regression/paper-margins-overrun.ly
  M input/regression/phrasing-slur-multiple.ly
  M input/regression/repeat-unfold.ly
  M input/regression/repeat-volta.ly
  M input/regression/skiptypesetting-all-true.ly
  M input/regression/skiptypesetting-bar-check.ly
  M input/regression/slur-multiple-linebreak.ly
  M input/regression/slur-multiple.ly
  M input/regression/spacing-loose-grace-error.ly
  M input/regression/stem-tremolo.ly
  M input/regression/tablature-negative-fret.ly
  M input/regression/tablature-zero-finger.ly
  M input/regression/tie-arpeggio.ly
  M input/regression/tie-unterminated.ly
  M input/regression/warn-conflicting-key-signatures.ly
  A input/regression/warn-expected-warning-missing.ly
  M input/regression/warn-unterminated-span-dynamic.ly
  M lily/warn-scheme.cc
  M scm/lily.scm





reply via email to

[Prev in Thread] Current Thread [Next in Thread]