From 0427fae00471a8ed6b5de803a5d96738ed822532 Mon Sep 17 00:00:00 2001 From: Dan Eble Date: Sat, 13 Nov 2021 12:23:56 -0500 Subject: [PATCH 1/2] Fix a warning message when creating a translator Correct a warning message expected in regtest invalid-engraver.ly. --- lily/translator-group.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lily/translator-group.cc b/lily/translator-group.cc index 3407318246..064bbc3381 100644 --- a/lily/translator-group.cc +++ b/lily/translator-group.cc @@ -127,6 +127,8 @@ Translator_group::create_child_translator (SCM sev) for (SCM trans : ly_scm_list (def->get_translator_names (ops))) { + SCM arg = trans; // in case we want to print the original value below + if (ly_is_symbol (trans)) trans = get_translator_creator (trans); if (ly_is_procedure (trans)) @@ -136,7 +138,7 @@ Translator_group::create_child_translator (SCM sev) Translator *instance = unsmob (trans); if (!instance) { - warning (_f ("cannot find: `%s'", ly_scm_write_string (trans).c_str ())); + warning (_f ("cannot find: `%s'", ly_scm_write_string (arg).c_str ())); continue; } -- GitLab From ece2a735310bd74e49f8c13e2a69a6c819387f59 Mon Sep 17 00:00:00 2001 From: Dan Eble Date: Fri, 29 Jan 2021 21:05:02 -0500 Subject: [PATCH 2/2] Enable warning-as-error in a bunch of regtests Tests that expect specific warnings should treat warnings as errors so that they will fail if there are unexpected warnings. --- input/regression/beam-quarter.ly | 2 +- input/regression/bom-mark.ly | 2 +- input/regression/clef-warn.ly | 2 +- input/regression/glissando-no-break.ly | 2 +- input/regression/harp-pedals-sanity-checks.ly | 2 +- input/regression/harp-pedals.ly | 2 +- input/regression/header-cyclic-reference.ly | 2 +- input/regression/incompatible-stem-warning.ly | 2 +- input/regression/instrument-switch-invalid-warning.ly | 2 +- input/regression/invalid-engraver.ly | 2 +- input/regression/loglevels.ly | 2 +- input/regression/markup-brace-warning.ly | 2 +- input/regression/markup-cyclic-reference.ly | 2 +- input/regression/markup-depth-non-terminating.ly | 2 +- input/regression/markup-music-glyph.ly | 2 +- input/regression/page-break-warn-forbidden.ly | 2 +- input/regression/page-spacing-system-count-overfull.ly | 2 +- input/regression/page-turn-page-breaking-badturns.ly | 2 +- input/regression/paper-margins-consistency.ly | 2 +- input/regression/paper-margins-overrun.ly | 2 +- input/regression/phrasing-slur-multiple.ly | 2 +- input/regression/skiptypesetting-bar-check.ly | 2 +- input/regression/slur-multiple-linebreak.ly | 2 +- input/regression/slur-multiple.ly | 2 +- input/regression/stem-tremolo.ly | 2 +- input/regression/tablature-micro-tone.ly | 2 +- input/regression/tablature-negative-fret.ly | 2 +- input/regression/tablature-zero-finger.ly | 2 +- input/regression/tie-arpeggio.ly | 2 +- input/regression/tie-unterminated.ly | 2 +- input/regression/warn-conflicting-key-signatures.ly | 2 +- input/regression/warn-unterminated-span-dynamic.ly | 2 +- 32 files changed, 32 insertions(+), 32 deletions(-) diff --git a/input/regression/beam-quarter.ly b/input/regression/beam-quarter.ly index 7c9431de28..8717947b42 100644 --- a/input/regression/beam-quarter.ly +++ b/input/regression/beam-quarter.ly @@ -1,6 +1,6 @@ \version "2.19.21" -#(ly:set-option 'warning-as-error #f) +#(ly:set-option 'warning-as-error #t) #(ly:expect-warning (_ "stem does not fit in beam")) #(ly:expect-warning (_ "beam was started here")) diff --git a/input/regression/bom-mark.ly b/input/regression/bom-mark.ly index 31f06b7ab6..2817bc4349 100644 --- a/input/regression/bom-mark.ly +++ b/input/regression/bom-mark.ly @@ -1,5 +1,5 @@ #(ly:expect-warning (_ "stray UTF-8 BOM encountered")) -#(ly:set-option 'warning-as-error #f) +#(ly:set-option 'warning-as-error #t) \version "2.16.0" diff --git a/input/regression/clef-warn.ly b/input/regression/clef-warn.ly index 7814e75725..62eaffab59 100644 --- a/input/regression/clef-warn.ly +++ b/input/regression/clef-warn.ly @@ -1,6 +1,6 @@ \version "2.16.0" -#(ly:set-option 'warning-as-error #f) +#(ly:set-option 'warning-as-error #t) #(ly:expect-warning (_ "unknown clef type `~a'") "foo") % We don't need to match the whole list of clefs, the beginning will suffice #(ly:expect-warning (_ "supported clefs: ~a") "C F G G2") diff --git a/input/regression/glissando-no-break.ly b/input/regression/glissando-no-break.ly index 713bc0514f..7e3dcbe8da 100644 --- a/input/regression/glissando-no-break.ly +++ b/input/regression/glissando-no-break.ly @@ -1,5 +1,5 @@ \version "2.19.21" -#(ly:set-option 'warning-as-error #f) +#(ly:set-option 'warning-as-error #t) #(ly:expect-warning (_ "forced break was overridden by some other event, should you be using bar checks?")) \header { diff --git a/input/regression/harp-pedals-sanity-checks.ly b/input/regression/harp-pedals-sanity-checks.ly index 6a2e3cb6f2..b83eb55853 100644 --- a/input/regression/harp-pedals-sanity-checks.ly +++ b/input/regression/harp-pedals-sanity-checks.ly @@ -1,6 +1,6 @@ \version "2.21.0" -#(ly:set-option 'warning-as-error #f) +#(ly:set-option 'warning-as-error #t) #(ly:expect-warning (_ "Harp pedal diagram contains dividers at positions ~a. Normally, there is only one divider after the third pedal.") '(1 3 5)) #(ly:expect-warning (_ "Harp pedal diagram contains dividers at positions ~a. Normally, there is only one divider after the third pedal.") '(4)) #(ly:expect-warning (_ "Harp pedal diagram contains ~a pedals rather than the usual 7.") 5) diff --git a/input/regression/harp-pedals.ly b/input/regression/harp-pedals.ly index ebbe899342..39023a305b 100644 --- a/input/regression/harp-pedals.ly +++ b/input/regression/harp-pedals.ly @@ -1,6 +1,6 @@ \version "2.21.0" -#(ly:set-option 'warning-as-error #f) +#(ly:set-option 'warning-as-error #t) #(ly:expect-warning (_ "Harp pedal diagram contains ~a pedals rather than the usual 7.") 0) #(ly:expect-warning (_ "Harp pedal diagram does not contain a divider (usually after third pedal).")) #(ly:expect-warning (_ "Harp pedal diagram contains ~a pedals rather than the usual 7.") 1) diff --git a/input/regression/header-cyclic-reference.ly b/input/regression/header-cyclic-reference.ly index 765f57091d..2a50d76263 100644 --- a/input/regression/header-cyclic-reference.ly +++ b/input/regression/header-cyclic-reference.ly @@ -1,5 +1,5 @@ \version "2.16.0" -#(ly:set-option 'warning-as-error #f) +#(ly:set-option 'warning-as-error #t) #(ly:expect-warning (_ "Recursive definition of property ~a detected!") 'header:title) #(ly:expect-warning (_ "Recursive definition of property ~a detected!") 'header:composer) diff --git a/input/regression/incompatible-stem-warning.ly b/input/regression/incompatible-stem-warning.ly index 7115741b1a..ce39ab50d6 100644 --- a/input/regression/incompatible-stem-warning.ly +++ b/input/regression/incompatible-stem-warning.ly @@ -1,5 +1,5 @@ \version "2.16.0" -#(ly:set-option 'warning-as-error #f) +#(ly:set-option 'warning-as-error #t) #(ly:expect-warning (ly:translate-cpp-warning-scheme "adding note head to incompatible stem (type = %d/%d)") 1 1) #(ly:expect-warning (ly:translate-cpp-warning-scheme "maybe input should specify polyphonic voices")) #(ly:expect-warning (ly:translate-cpp-warning-scheme "adding note head to incompatible stem (type = %d/%d)") 1 8) diff --git a/input/regression/instrument-switch-invalid-warning.ly b/input/regression/instrument-switch-invalid-warning.ly index 0ef544cc3d..97919042e1 100644 --- a/input/regression/instrument-switch-invalid-warning.ly +++ b/input/regression/instrument-switch-invalid-warning.ly @@ -1,5 +1,5 @@ \version "2.19.21" -#(ly:set-option 'warning-as-error #f) +#(ly:set-option 'warning-as-error #t) #(ly:expect-warning (_ "No such instrument: ~a") "bassClar") \header { diff --git a/input/regression/invalid-engraver.ly b/input/regression/invalid-engraver.ly index b83befbae2..351daadd35 100644 --- a/input/regression/invalid-engraver.ly +++ b/input/regression/invalid-engraver.ly @@ -1,6 +1,6 @@ \version "2.16.0" -#(ly:set-option 'warning-as-error #f) +#(ly:set-option 'warning-as-error #t) #(ly:expect-warning (ly:translate-cpp-warning-scheme "unknown translator: `%s'") "Rhythmic_column_engraver_foo") #(ly:expect-warning (ly:translate-cpp-warning-scheme "cannot find: `%s'") "Rhythmic_column_engraver_foo") diff --git a/input/regression/loglevels.ly b/input/regression/loglevels.ly index 91b239a3e0..e37530a699 100644 --- a/input/regression/loglevels.ly +++ b/input/regression/loglevels.ly @@ -1,6 +1,6 @@ \version "2.19.22" -#(ly:set-option 'warning-as-error #f) +#(ly:set-option 'warning-as-error #t) #(ly:expect-warning (_ "Test warning\n")) #(ly:expect-warning (_ "already have slur")) diff --git a/input/regression/markup-brace-warning.ly b/input/regression/markup-brace-warning.ly index cf8ef8dc91..20b3c1f15d 100644 --- a/input/regression/markup-brace-warning.ly +++ b/input/regression/markup-brace-warning.ly @@ -1,6 +1,6 @@ \version "2.16.0" -#(ly:set-option 'warning-as-error #f) +#(ly:set-option 'warning-as-error #t) #(ly:expect-warning (_ "no brace found for point size ~S ") 10) #(ly:expect-warning (_ "defaulting to ~S pt") 10.5) diff --git a/input/regression/markup-cyclic-reference.ly b/input/regression/markup-cyclic-reference.ly index c0a952e3ea..45292d489d 100644 --- a/input/regression/markup-cyclic-reference.ly +++ b/input/regression/markup-cyclic-reference.ly @@ -1,5 +1,5 @@ \version "2.19.13" -#(ly:set-option 'warning-as-error #f) +#(ly:set-option 'warning-as-error #t) #(ly:expect-warning (ly:translate-cpp-warning-scheme "Markup depth exceeds maximal value of %d; Markup: %s") 1024 'cycle-markup) #(ly:expect-warning (ly:translate-cpp-warning-scheme "Markup depth exceeds maximal value of %d; Markup: %s") 1024 'cycleII-markup) diff --git a/input/regression/markup-depth-non-terminating.ly b/input/regression/markup-depth-non-terminating.ly index 76db67f193..a19d1e240e 100644 --- a/input/regression/markup-depth-non-terminating.ly +++ b/input/regression/markup-depth-non-terminating.ly @@ -1,5 +1,5 @@ \version "2.16.0" -#(ly:set-option 'warning-as-error #f) +#(ly:set-option 'warning-as-error #t) #(ly:expect-warning (ly:translate-cpp-warning-scheme "Markup depth exceeds maximal value of %d; Markup: %s") 1024 "recursive-explosion-markup") \header { diff --git a/input/regression/markup-music-glyph.ly b/input/regression/markup-music-glyph.ly index 32c921b98a..c5bfdfa083 100644 --- a/input/regression/markup-music-glyph.ly +++ b/input/regression/markup-music-glyph.ly @@ -1,6 +1,6 @@ \version "2.21.0" -#(ly:set-option 'warning-as-error #f) +#(ly:set-option 'warning-as-error #t) #(ly:expect-warning (_ "Cannot find glyph ~a") "UNKNOWN-GLYPH") \header { diff --git a/input/regression/page-break-warn-forbidden.ly b/input/regression/page-break-warn-forbidden.ly index 514962e1fc..f485cd57b6 100644 --- a/input/regression/page-break-warn-forbidden.ly +++ b/input/regression/page-break-warn-forbidden.ly @@ -1,6 +1,6 @@ \version "2.16.0" -#(ly:set-option 'warning-as-error #f) +#(ly:set-option 'warning-as-error #t) #(ly:expect-warning (_ "forced break was overridden by some other event, should you be using bar checks?")) #(ly:expect-warning (_ "forced break was overridden by some other event, should you be using bar checks?")) diff --git a/input/regression/page-spacing-system-count-overfull.ly b/input/regression/page-spacing-system-count-overfull.ly index 32c744fb84..be02cc6b40 100644 --- a/input/regression/page-spacing-system-count-overfull.ly +++ b/input/regression/page-spacing-system-count-overfull.ly @@ -1,5 +1,5 @@ \version "2.16.0" -#(ly:set-option 'warning-as-error #f) +#(ly:set-option 'warning-as-error #t) #(ly:expect-warning (_ "cannot find line breaking that satisfies constraints")) \header { diff --git a/input/regression/page-turn-page-breaking-badturns.ly b/input/regression/page-turn-page-breaking-badturns.ly index 52838112c7..327e8814ad 100644 --- a/input/regression/page-turn-page-breaking-badturns.ly +++ b/input/regression/page-turn-page-breaking-badturns.ly @@ -1,5 +1,5 @@ \version "2.19.21" -#(ly:set-option 'warning-as-error #f) +#(ly:set-option 'warning-as-error #t) #(ly:expect-warning (_ "cannot fit the first page turn onto a single page. Consider setting first-page-number to an even number.")) \header { diff --git a/input/regression/paper-margins-consistency.ly b/input/regression/paper-margins-consistency.ly index 91a13d5468..4048355462 100644 --- a/input/regression/paper-margins-consistency.ly +++ b/input/regression/paper-margins-consistency.ly @@ -1,6 +1,6 @@ \version "2.19.21" -#(ly:set-option 'warning-as-error #f) +#(ly:set-option 'warning-as-error #t) #(ly:expect-warning (_ "margins do not fit with line-width, setting default values")) \header { diff --git a/input/regression/paper-margins-overrun.ly b/input/regression/paper-margins-overrun.ly index 6c929233e6..e2054ceda8 100644 --- a/input/regression/paper-margins-overrun.ly +++ b/input/regression/paper-margins-overrun.ly @@ -1,6 +1,6 @@ \version "2.19.21" -#(ly:set-option 'warning-as-error #f) +#(ly:set-option 'warning-as-error #t) #(ly:expect-warning (_ "systems run off the page due to improper paper settings, setting default values")) \header { diff --git a/input/regression/phrasing-slur-multiple.ly b/input/regression/phrasing-slur-multiple.ly index adf8221845..ae3277e14f 100644 --- a/input/regression/phrasing-slur-multiple.ly +++ b/input/regression/phrasing-slur-multiple.ly @@ -1,6 +1,6 @@ \version "2.19.29" -#(ly:set-option 'warning-as-error #f) +#(ly:set-option 'warning-as-error #t) #(ly:expect-warning (_ "already have phrasing slur")) #(ly:expect-warning (_ "cannot end phrasing slur")) #(ly:expect-warning (_ "unterminated phrasing slur")) diff --git a/input/regression/skiptypesetting-bar-check.ly b/input/regression/skiptypesetting-bar-check.ly index ec467da75a..5e3cadc7ff 100644 --- a/input/regression/skiptypesetting-bar-check.ly +++ b/input/regression/skiptypesetting-bar-check.ly @@ -1,5 +1,5 @@ \version "2.19.21" -#(ly:set-option 'warning-as-error #f) +#(ly:set-option 'warning-as-error #t) #(ly:expect-warning (ly:translate-cpp-warning-scheme "barcheck failed at: %s") "3/4") \header { diff --git a/input/regression/slur-multiple-linebreak.ly b/input/regression/slur-multiple-linebreak.ly index 206f488244..b3d1011fba 100644 --- a/input/regression/slur-multiple-linebreak.ly +++ b/input/regression/slur-multiple-linebreak.ly @@ -1,6 +1,6 @@ \version "2.19.21" -#(ly:set-option 'warning-as-error #f) +#(ly:set-option 'warning-as-error #t) #(ly:expect-warning (_ "already have slur")) \header { diff --git a/input/regression/slur-multiple.ly b/input/regression/slur-multiple.ly index 007b69773e..15ac72000a 100644 --- a/input/regression/slur-multiple.ly +++ b/input/regression/slur-multiple.ly @@ -1,6 +1,6 @@ \version "2.19.29" -#(ly:set-option 'warning-as-error #f) +#(ly:set-option 'warning-as-error #t) #(ly:expect-warning (_ "already have slur")) #(ly:expect-warning (_ "cannot end slur")) #(ly:expect-warning (_ "unterminated slur")) diff --git a/input/regression/stem-tremolo.ly b/input/regression/stem-tremolo.ly index 032f900ecc..3631b4912c 100644 --- a/input/regression/stem-tremolo.ly +++ b/input/regression/stem-tremolo.ly @@ -1,6 +1,6 @@ \version "2.17.6" -#(ly:set-option 'warning-as-error #f) +#(ly:set-option 'warning-as-error #t) #(ly:expect-warning (_ "tremolo duration is too long")) #(ly:expect-warning (_ "tremolo duration is too long")) diff --git a/input/regression/tablature-micro-tone.ly b/input/regression/tablature-micro-tone.ly index a7f891c048..28ee716588 100644 --- a/input/regression/tablature-micro-tone.ly +++ b/input/regression/tablature-micro-tone.ly @@ -12,7 +12,7 @@ case for the last four of the examples pitches. Micro-tones assigned to strings work nicely." } -#(ly:set-option 'warning-as-error #f) +#(ly:set-option 'warning-as-error #t) #(for-each (lambda (pitch) (ly:expect-warning (_ "No string for pitch ")) diff --git a/input/regression/tablature-negative-fret.ly b/input/regression/tablature-negative-fret.ly index 28d08f427d..cd0ebf5f8c 100644 --- a/input/regression/tablature-negative-fret.ly +++ b/input/regression/tablature-negative-fret.ly @@ -1,5 +1,5 @@ \version "2.19.21" -#(ly:set-option 'warning-as-error #f) +#(ly:set-option 'warning-as-error #t) #(ly:expect-warning (_ "Requested string for pitch requires negative fret: string ~a pitch ~a") 1 "#") #(ly:expect-warning (_ "Ignoring string request and recalculating.")) #(ly:expect-warning (_ "Negative fret for pitch ~a on string ~a") "#" 1) diff --git a/input/regression/tablature-zero-finger.ly b/input/regression/tablature-zero-finger.ly index a22a58e51e..f9ffc4d0f8 100644 --- a/input/regression/tablature-zero-finger.ly +++ b/input/regression/tablature-zero-finger.ly @@ -1,5 +1,5 @@ \version "2.19.21" -#(ly:set-option 'warning-as-error #f) +#(ly:set-option 'warning-as-error #t) #(ly:expect-warning (_ "No open string for pitch ~a") "#") \header { diff --git a/input/regression/tie-arpeggio.ly b/input/regression/tie-arpeggio.ly index eabcaa78cb..d65333878a 100644 --- a/input/regression/tie-arpeggio.ly +++ b/input/regression/tie-arpeggio.ly @@ -1,5 +1,5 @@ \version "2.19.21" -#(ly:set-option 'warning-as-error #f) +#(ly:set-option 'warning-as-error #t) #(ly:expect-warning (_ "unterminated tie")) #(ly:expect-warning (_ "unterminated tie")) diff --git a/input/regression/tie-unterminated.ly b/input/regression/tie-unterminated.ly index 1f5dd010af..d56369a882 100644 --- a/input/regression/tie-unterminated.ly +++ b/input/regression/tie-unterminated.ly @@ -1,5 +1,5 @@ \version "2.19.21" -#(ly:set-option 'warning-as-error #f) +#(ly:set-option 'warning-as-error #t) #(ly:expect-warning (_ "unterminated tie")) \header { diff --git a/input/regression/warn-conflicting-key-signatures.ly b/input/regression/warn-conflicting-key-signatures.ly index 12e9d575ee..48d3c5a957 100644 --- a/input/regression/warn-conflicting-key-signatures.ly +++ b/input/regression/warn-conflicting-key-signatures.ly @@ -1,5 +1,5 @@ \version "2.16.0" -#(ly:set-option 'warning-as-error #f) +#(ly:set-option 'warning-as-error #t) #(ly:expect-warning (ly:translate-cpp-warning-scheme "conflict with event: `%s'") "key-change-event") #(ly:expect-warning (ly:translate-cpp-warning-scheme "discarding event: `%s'") "key-change-event") diff --git a/input/regression/warn-unterminated-span-dynamic.ly b/input/regression/warn-unterminated-span-dynamic.ly index 43e0c9cbba..b77cb85199 100644 --- a/input/regression/warn-unterminated-span-dynamic.ly +++ b/input/regression/warn-unterminated-span-dynamic.ly @@ -1,6 +1,6 @@ \version "2.16.0" -#(ly:set-option 'warning-as-error #f) +#(ly:set-option 'warning-as-error #t) #(ly:expect-warning (ly:translate-cpp-warning-scheme "unterminated %s") "crescendo") #(ly:expect-warning (ly:translate-cpp-warning-scheme "unterminated %s") "decrescendo") -- GitLab