]> git.donarmstrong.com Git - lilypond.git/commit
Fix 1477: Update regtests to suppress expected warnings
authorReinhold Kainhofer <reinhold@kainhofer.com>
Thu, 29 Sep 2011 09:27:02 +0000 (11:27 +0200)
committerReinhold Kainhofer <reinhold@kainhofer.com>
Thu, 29 Sep 2011 09:27:02 +0000 (11:27 +0200)
commitb8e19438b2d69674efcf408586950e384d5e4b06
tree39d84e9111890fdb6315f09b1c18a41b9b6f1bbd
parent1ecdd56060e34a00b2be6b38029b286a601ea6f8
Fix 1477: Update regtests to suppress expected warnings

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 erro) 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 and
safe.ly).
38 files changed:
input/regression/bar-number-check-warning.ly
input/regression/beam-quarter.ly
input/regression/bom-mark.ly
input/regression/clef-warn.ly
input/regression/glissando-no-break.ly
input/regression/harp-pedals-sanity-checks.ly
input/regression/harp-pedals.ly
input/regression/header-cyclic-reference.ly
input/regression/incompatible-stem-warning.ly
input/regression/instrument-switch-invalid-warning.ly
input/regression/invalid-engraver.ly
input/regression/loglevels.ly
input/regression/lyric-combine-empty-warning.ly
input/regression/markup-brace-warning.ly
input/regression/markup-cyclic-reference.ly
input/regression/markup-depth-non-terminating.ly
input/regression/markup-music-glyph.ly
input/regression/page-break-warn-forbidden.ly
input/regression/page-spacing-system-count-overfull.ly
input/regression/page-turn-page-breaking-badturns.ly
input/regression/paper-margins-consistency.ly
input/regression/paper-margins-overrun.ly
input/regression/phrasing-slur-multiple.ly
input/regression/repeat-unfold.ly
input/regression/repeat-volta.ly
input/regression/skiptypesetting-all-true.ly
input/regression/skiptypesetting-bar-check.ly
input/regression/slur-multiple-linebreak.ly
input/regression/slur-multiple.ly
input/regression/spacing-loose-grace-error.ly
input/regression/stem-tremolo.ly
input/regression/tablature-negative-fret.ly
input/regression/tablature-zero-finger.ly
input/regression/tie-arpeggio.ly
input/regression/tie-unterminated.ly
input/regression/warn-conflicting-key-signatures.ly
input/regression/warn-expected-warning-missing.ly [new file with mode: 0644]
input/regression/warn-unterminated-span-dynamic.ly