+(define-public (relevant-book-systems book)
+ (let ((systems (ly:paper-book-systems book)))
+ ;; skip booktitles.
+ (if (and (not (ly:get-option 'include-book-title-preview))
+ (pair? systems)
+ (ly:prob-property (car systems) 'is-book-title #f))
+ (cdr systems)
+ systems)))
+
+(define-public (relevant-dump-systems systems)
+ (let ((to-dump-systems '()))
+ (for-each
+ (lambda (sys)
+ (if (or (paper-system-title? sys)
+ (not (pair? to-dump-systems))
+ (paper-system-title? (car to-dump-systems)))
+ (set! to-dump-systems (cons sys to-dump-systems))))
+ systems)
+ to-dump-systems))
+
+(define missing-stencil-list '())
+
+(define-public (backend-testing output-module)
+ (define (missing-stencil-expression name)
+ (begin
+ (ly:warning (_ "missing stencil expression `~S'") name)
+ ""))
+
+ (map (lambda (x)
+ (if (not (module-defined? output-module x))
+ (begin
+ (module-define! output-module x
+ (lambda* (#:optional y . z)
+ (missing-stencil-expression x)))
+ (set! missing-stencil-list (append (list x)
+ missing-stencil-list)))))
+ (ly:all-stencil-commands)))
+
+(define-public (remove-stencil-warnings output-module)
+ (for-each
+ (lambda (x)
+ (module-remove! output-module x))
+ missing-stencil-list))