Expect a warning several times: Difference between revisions

m args -> arg
m Add Category
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
There are times when your LilyPond source file prints warnings when compiled and you may want to suppress these warnings from the output.  LilyPond has a Scheme function for this: <code>ly:expect-warning</code>. However, there are times when the same warning is printed  several times and <code>ly:expect-warning</code> will only hide one warning at a time.  Typing this function several times in a row is tedious.
There are times when your LilyPond source file prints warnings when compiled and you may want to suppress these warnings from the output.  LilyPond has a Scheme function for this: <code>ly:expect-warning</code>. However, there are times when the same warning is printed  several times and <code>ly:expect-warning</code> will only hide one warning at a time.  Typing this function several times in a row is tedious.


The Scheme function below takes a string that will match some part of the warning, just like <code>ly:expect-warning</code>, but it also takes an integer for the number of times the warning is printed.
The [https://lilypond.org/doc/v2.24/Documentation/internals/scheme-functions Scheme function] below takes a string that will match some part of the warning, just like <code>ly:expect-warning</code>, but it also takes an integer for the number of times the warning is printed.


<pre>
<pre>
Line 13: Line 13:
<code>#(expect-warning-times 4 "omitting tuplet bracket")</code>
<code>#(expect-warning-times 4 "omitting tuplet bracket")</code>


The hint from the documentation: [https://lilypond.org/doc/v2.25/Documentation/internals/scheme-functions scheme-functions]
[[Category:Scheme]]