X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=sidebyside;f=input%2Fregression%2Fdisplay-lily-tests.ly;h=848ff190d86b147cdbbc12fc207d40e6522dc59d;hb=ddd74753371d73e65bb57d086fe376e771ef86b8;hp=a6b1dacac74c4d93321e84a85b7620d059e9b5c4;hpb=31b82cda2639591fd180f2c174ded1737b673336;p=lilypond.git diff --git a/input/regression/display-lily-tests.ly b/input/regression/display-lily-tests.ly index a6b1dacac7..848ff190d8 100644 --- a/input/regression/display-lily-tests.ly +++ b/input/regression/display-lily-tests.ly @@ -1,12 +1,12 @@ -\version "2.11.6" - +\version "2.15.5" #(use-modules (srfi srfi-13) (ice-9 format)) %%% %%% Testing utilities %%% - +#(use-modules (scm display-lily)) +#(memoize-clef-names supported-clefs) #(define (parse-lily-and-compute-lily-string chr port) (let ((lily-string (call-with-output-string (lambda (out) @@ -17,9 +17,7 @@ (display c out)))))) `(let* ((parser-clone (ly:parser-clone parser)) (input-str (string-trim-both ,lily-string)) - (music (car (ly:music-property (parse-string-result input-str - parser-clone) - 'elements))) + (music (ly:parse-string-expression parser-clone input-str)) (result-str (string-trim-both (music->lily-string music parser-clone)))) (cons input-str result-str)))) @@ -34,27 +32,13 @@ (let ((input (car strings)) (output (cdr strings))) (set! test-number (1+ test-number)) - (if (string=? input output) - (make-music 'SequentialMusic 'void #t) - (make-music 'SequentialMusic - 'elements - (list (ly:parser-lookup parser 'fatText) - (make-music 'EventChord - 'elements (list (make-music 'LineBreakEvent - 'break-permission 'force))) - (make-music 'EventChord - 'elements (list (make-music 'SkipEvent - 'duration (ly:make-duration 0 0 1 1)) - (make-music 'TextScriptEvent - 'direction -1 - 'text (markup #:column - (#:simple (format #f "Test #~a " test-number) - (if (string-null? result-info) - (markup #:bold "BUG") - (markup #:simple result-info)) - #:typewriter (lily-string->markup input) - #:typewriter (lily-string->markup output))))))))))))) - + (if (not (equal? input output)) + (ly:progress "Test ~a unequal: ~a. \nin = ~a\nout = ~a\n" + test-number + (if result-info + result-info "BUG") + input output)) + (make-music 'SequentialMusic 'void #t))))) test = #(define-music-function (parser location result-info strings) (string? pair?) @@ -64,24 +48,8 @@ test = %%% Tests %%% \header { - texidoc = \markup \column { \line { \typewriter display-lily-music unit tests } - \line { Real bugs (regressions) are marked as \bold BUG. } - \line { Known bugs are marked as TODO. } } -} - -\layout { - raggedright = ##t - indent = 0\cm - \context { - \Staff - \override StaffSymbol #'line-count = #1 - \remove "Time_signature_engraver" - \remove "Clef_engraver" - } - \context { - \Score - \remove "Bar_number_engraver" - } + texidoc = "This is a test of the display-lily-music unit. Problems are reported on the +stderr of this run." } %% Sequential music @@ -106,6 +74,8 @@ test = \test "" ##[ R1.*2/3 #] % MultiMeasureRestMusicGroup, MultiMeasureRestEvent \test "" ##[ \skip 2.*3/4 #] % SkipMusic \test "" ##[ < c\1 e\3 >4.*3/4-. #] % EventChord, NoteEvent, StringNumberEvent, ArticulationEvent +\test "" ##[ < c-1\4 >8 #] +\test "NOT A BUG" ##[ { < c e g c' > q8-. } #] % RepeatedChord %% tags \test "" ##[ { \tag #'foo { c4 d } } #] @@ -130,9 +100,9 @@ test = \test "" ##[ \lyricmode { a -- b } #] % HyphenEvent \test "" ##[ \lyricmode { a __ b } #] % ExtenderEvent \test "" ##[ \lyricmode { "a " } #] % LyricEvent -\test "" ##[ \lyricsto "foo" { bla bla } #] % LyricCombineMusic +\test "" ##[ \lyricsto "foo" { bla bla } #] % LyricCombineMusic \test "" ##[ { { c d } - \addlyrics { bla bla } } #] + \addlyrics { bla bla } } #] %% Drums \test "" ##[ \drums { hihat } #] @@ -154,7 +124,7 @@ test = \test "" ##[ { c-1 c^2 c_3 } #] % FingerEvent \test "" ##[ { c-"foo" c^"foo" c_"foo" } #] % TextScriptEvent \test "" ##[ { R1*4-"foo" R^"foo" R_"foo" } #] % MultiMeasureTextEvent -\test "" ##[ { c4-\harmonic c^\harmonic c_\harmonic } #] % HarmonicEvent +\test "" ##[ { < c\harmonic >4 < c e\harmonic > } #] % HarmonicEvent \test "" ##[ { c-\glissando c^\glissando c_\glissando } #] % GlissandoEvent \test "" ##[ { c-\arpeggio c^\arpeggio c_\arpeggio } #] % ArpeggioEvent \test "" ##[ { c\p c^\ff c_\sfz } #] % AbsoluteDynamicEvent @@ -162,9 +132,10 @@ test = \test "" ##[ { c( c) c^( c^) c_( c_) } #] % SlurEvent \test "" ##[ { c\< c\! c^\< c^\! c_\< c_\! } #] % CrescendoEvent \test "" ##[ { c\> c\! c^\> c^\! c_\> c_\! } #] % DecrescendoEvent +\test "" ##[ { c\episemInitium c\episemFinis } #] % EpisemaEvent \test "" ##[ { c\( c\) c^\( c^\) c_\( c_\) } #] % PhrasingSlurEvent -\test "" ##[ { c\sustainDown c\sustainUp } #] % SustainEvent -\test "" ##[ { c\sostenutoDown c\sostenutoUp } #] % SostenutoEvent +\test "" ##[ { c\sustainOn c\sustainOff } #] % SustainEvent +\test "" ##[ { c\sostenutoOn c\sostenutoOff } #] % SostenutoEvent \test "" ##[ \melisma #] \test "" ##[ \melismaEnd #] \test "" ##[ { c\startTextSpan c\stopTextSpan } #] % TextSpanEvent @@ -175,6 +146,8 @@ test = \test "" ##[ \breathe #] \test "" ##[ { c \[ c \] } #] % LigatureEvent \test "" ##[ \~ #] % PesOrFlexaEvent +\test "" ##[ { c-\bendAfter #3 } #] % BendAfterEvent +\test "" ##[ < c-\rightHandFinger #1 > #] % StrokeFingerEvent \test "" ##[ \break #] \test "" ##[ \noBreak #] @@ -184,13 +157,16 @@ test = \test "" ##[ \noPageTurn #] %% Checks -\test "" ##[ \octave a' #] % RelativeOctaveCheck +\test "" ##[ \octaveCheck a' #] % RelativeOctaveCheck \test "" ##[ | #] % BarCheck %% Marks \test "" ##[ \mark \default #] % MarkEvent \test "" ##[ \mark "Allegro" #] \test "" ##[ \tempo 4 = 120 #] % MetronomeChangeEvent +\test "" ##[ \tempo 4 = 108 ~ 116 #] +\test "" ##[ \tempo "Allegro" 4 = 132 #] +\test "" ##[ \tempo "Andante" #] %% key, time, clef, bar \test "" ##[ \key \default #] % KeyChangeEvent @@ -217,7 +193,6 @@ test = %% Repeats \test "" ##[ \repeat volta 2 { c d } #] % VoltaRepeatedMusic \test "" ##[ \repeat unfold 2 { c d } #] % UnfoldedRepeatedMusic -\test "" ##[ \repeat fold 2 { c d } #] % FoldedRepeatedMusic \test "" ##[ \repeat percent 2 { c d } #] % PercentRepeatedMusic \test "" ##[ \repeat tremolo 4 { c16 d } #] % TremoloRepeatedMusic \test "" ##[ \repeat volta 2 { c4 d } \alternative { { c d } { e f } } #] % @@ -239,9 +214,12 @@ test = \test "" ##[ \unset autoBeaming #] %% Layout properties \test "" ##[ \override Staff . Stem #'thickness = #4.0 #] % OverrideProperty -\test "" ##[ \once \override Beam #'thickness = #0.6 #] +\test "" ##[ \once \override Beam #'beam-thickness = #0.6 #] \test "" ##[ \revert Staff . Stem #'thickness #] % RevertProperty -\test "" ##[ \revert Beam #'thickness #] +\test "" ##[ \revert Beam #'beam-thickness #] +\test "NOT A BUG" ##[ \oneVoice #] % resetting a bunch of properties +\test "" ##[ \override StaffGrouper #'(staff-staff-spacing basic-distance) = #7 #] % nested properties +\test "" ##[ \revert StaffGrouper #'(staff-staff-spacing basic-distance) #] % nested properties %% \applyOutput \test "" ##[ \applyOutput #'Foo #(lambda (arg) (list)) #] @@ -251,7 +229,7 @@ test = %% \partial \test "" ##[ \partial 2 #] \test "" ##[ \partial 8. #] -\test #"TODO? exotic durations in \\partial" ##[ \partial 4*2/3 #] +\test "" ##[ \partial 4*2/3 #] %% \partcombine \test "" ##[ \partcombine { c e } @@ -260,3 +238,16 @@ test = %% Cue notes \test "" ##[ \cueDuring #"foo" #1 { c d } #] \test "" ##[ \quoteDuring #"foo" { c d } #] + +%% \ottava +\test "" ##[ \ottava #1 #] % OttavaMusic + +%% \tweak +\test "" ##[ < \tweak #'duration-log #2 c > #] +\test "" ##[ < c \tweak #'transparent ##t e > #] +\test "" ##[ < \tweak #'color #'(1.0 0.0 0.0) \tweak #'duration-log #2 c > #] +\test "" ##[ c-\tweak #'font-size #3 -> #] + +%% end test. + +#(read-hash-extend #\[ #f) %{ ] %}