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).
Fix 1477: Add (ly:expect-warning msg args) 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 does not yet adapt all regtests that are supposed to print warnings
to this new approach. This will follow in a separate patch.
* A list of ASCII aliases for special characters has been added.
* New add-text-replacements! command for \paper blocks.
* New markup command \replace.
James Lowe [Thu, 15 Sep 2011 21:44:42 +0000 (22:44 +0100)]
Doc: NR Clarify finer point of repeat unfold
This is for tracker issue 1801.
Explain as an example, that \repeat unfold 2 {music expression} is
not always the same as writing out the music expression twice - especially
in a \relative context.
Message-handling: Make the Input class use the functions in warn.cc
This allows us to handle all warnings/error really similar in warn.cc.
For example, we can then simply suppress some warnings by only checking
in warn.cc. This patch makes the whole handling much more consistent,
as now everything is in warn.cc
David Kastrup [Wed, 21 Sep 2011 21:38:10 +0000 (23:38 +0200)]
Parts from the optional music argument patch to make define-event-function work
Note that define-event-function, define-scheme-function and define-music-function
now wrongly claim to support optional music function arguments in their
documentation strings, in order not to complicate merging.
Mike Solomon [Thu, 22 Sep 2011 08:12:40 +0000 (10:12 +0200)]
Terminates Slur::outside_staff_callback early if grob is out of slur's range.
This reduces the chance that there will be a programming error when looking
for a Bezier intersection, as grobs that no longer intersect with the slur
will not be considered for shifting.
Mike Solomon [Thu, 22 Sep 2011 07:05:58 +0000 (09:05 +0200)]
Fixes Issue 1301 (colliding note and clef).
Loose columns are now:
-) better spaced between their fixed counterpoints
see spacing-loose-columns.cc
-) spaced with respect to the left column against which they collide,
not the column directly to the left.
see spacing-determine-loose-columns.cc
Joe Neeman [Mon, 19 Sep 2011 15:32:58 +0000 (08:32 -0700)]
Fix 1896: chord names can have instrument names.
This fixes a problem in the fix for issue 1598, which disabled
instrument names for non-spaceable staves. Now we include non-spaceable
staves, but not if there are some spaceable ones.
Fix 380: Try to auto-detect cyclic references in header fields
Inside \fromproperty, simply change the props so that all references to the
currently interpreted property point to a function that prints out
a warning and returns a null markup, while interpreting the contents
of the property.
This is a specialized case of the cycle detection, since the hare+
tortoise algorithm does not tell us where the cycle was causes.
For properties we have a simple way to detect cyclic dependencies,
so we can tell the user which definition caused the problem.